in reply to Re^2: Return value from positive look behind
in thread Return value from positive look behind
To illustrate the effect noted in choroba's reply try the following:
use strict; use warnings; my $body_text="5 minutes left. Wait 6 minutes before nagging again."; 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"; }
Prints:
1st try: 5 2nd try: 6
|
|---|