perlquestion
Mahoota
I am trying to write a regular expression that will store the actual string matched as a variable so it can be compared to another string matched in another regular expression..
I have used the following but when i print out $thisresult it seems to have stored 1 (positive) as opposed to the actual string matched.
I am trying to write a script that will only print "expression found" if the string matched is not the same as the string matched previously.
<code>
$thisresult = ($teststring =~ /[aft][edt].[ftg]...v{2,3}/g);
if ($thisresult)
{if (!$lastresult)
{print "Expression found\n";
}
}
$lastresult = $thisresult;
</code>
Any ideas?
<p><b>edited:</b> Thu Jun 27 14:24:25 2002 by [jeffa] - added code tags</p>