in reply to storing string matched by regular expression
(Note the parentheses around $thisresult and in the pattern). If the match fails, $thisresult would be set to undef.($thisresult) = ($teststring =~ /([aft][edt].[ftg]...v{2,3})/g); if ($thisresult) { if (!$lastresult) { print "Expression found\n"; } } $lastresult = $thisresult;
|
|---|