How are you searching for two words and using AND?
What do you want to do when you ignore AND?
Main Topics
Browse All Topicsi want to search for two words and inbetween them i use AND
whats the code for ignoring AND?
any help would be appriciated,thanx
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'll interpret the question as having
word1 AND word2
and wanting to match them and "ignoring" the AND.
$string='word1 AND word2';
if ($string ~= /word1\s+\w+\s+word2/i) {
print "Matched\n";
}
The above matches word1 followed by one or more whitespace, one or more word characters and one or more whitespace followed by word2. The match is case insensitive.
There's loads of other combinations, but you need to be much more specific with your requirements.
http://www.experts-exchang
thats my code,thnx to ozo i managed to get the double quotes.now i mean if someone types AND inbetween two words it should look for both the words.Tintin is almost there but i didnt know how it would be on my code.thanks.
Business Accounts
Answer for Membership
by: teraplanePosted on 2006-11-05 at 16:43:14ID: 17878239
Do you mean you want to serach for the patter 'word1 AND word2' ?
You just say
if ( str =~ /word1 AND word2/ )
{
print "Found word1 word2\n";
}