@Choroba: Another unusual thing happens if I run the code 2x in a row. The first if{} works but the second does not. Does the regex somehow need to reset?<\p>
my $body_text="there are 5 minutes left in the program"; if ($body_text=~m/(\d{1,2})(?=\smins|\sminutes)/g) { print "1st try: " . $1 . "\n"; } if ($body_text=~m/(\d{1,2})(?=\smins|\sminutes)/g) { print "2nd try: " . $1 . "\n"; }
In reply to Re^2: Return value from positive look behind
by bestresearch2
in thread Return value from positive look behind
by bestresearch2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |