bestresearch2 has asked for the wisdom of the Perl Monks concerning the following question:
I believe positive lookbehind is supposed to return the "5" in the following but it returns "minutes" instead. Any help deeply appreciated!
my $body_text="there are 5 minutes left in the program"; if ($body_text=~m/\d{1,2}(?=\s(mins|minutes))/g) { print $1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Return value from positive look behind
by choroba (Cardinal) on Nov 11, 2020 at 17:05 UTC | |
by bestresearch2 (Novice) on Nov 11, 2020 at 17:11 UTC | |
by bestresearch2 (Novice) on Nov 11, 2020 at 17:15 UTC | |
by choroba (Cardinal) on Nov 11, 2020 at 17:17 UTC | |
by GrandFather (Saint) on Nov 11, 2020 at 20:28 UTC | |
|
Re: Return value from positive look behind (updated)
by AnomalousMonk (Archbishop) on Nov 11, 2020 at 23:12 UTC | |
|
Re: Return value from positive look behind
by Anonymous Monk on Nov 12, 2020 at 14:26 UTC | |
by AnomalousMonk (Archbishop) on Nov 12, 2020 at 16:15 UTC |