#!/usr/local/bin/perl $teststr1='perl.org'; $teststr2='perl .org'; $termstr1='.org'; $termstr2='perl'; # I don't want to find 'perl' in 'perl.org' if ($teststr1 =~ m/\b$termstr2\b/) { print "uggh1\n"; } # I don't want to find '.org' in 'perl.org' if ($teststr1 =~ m/\b$termstr1\b/) { print "uggh2\n"; } # I DO want to find '.org' in 'perl .org' if ($teststr2 =~ m/\b$termstr1\b/) { print "hurray1\n"; } # I DO want to find 'perl' in 'perl .org' if ($teststr2 =~ m/\b$termstr2\b/) { print "hurray2\n"; } >...
In reply to Help with matching .org by bestresearch2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |