and$string = 'My Test Data'; $regex = 'm/\btest\b/i'; if ($string =~ $regex){print "It Works!\n"}else{print "No joy!\n"};
$string = 'My Test Data'; $regex = 'm/\bTest\b/i'; $stmt = 'if ($string =~ $regex){print "It Works!\n"}else{print "No joy +!\n"}'; eval $stmt;
In reply to Regex in string to be used for matching. by swares
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |