in reply to Re: $scaler inside a RegEx
in thread $scaler inside a RegEx
You might have an easier time at typing your regexp if you used qr// instead of double quotes:$criteria = "(abc|123)\$"; $teststring = "Foo walks up and says: abc"; if ( $teststring =~ /$criteria/ ) { print "Got $1\n"; } else { print "uh no, it did not\n"; } __END__ output ====== Got abc
$criteria = qr/(abc|123)$/; ...
|
|---|