swares has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex in string to be used for matching.
by ikegami (Patriarch) on Nov 09, 2009 at 20:57 UTC | |
by Anonymous Monk on Nov 09, 2009 at 22:02 UTC | |
by ikegami (Patriarch) on Nov 09, 2009 at 22:25 UTC |