in reply to Re^2: REGEXP: only need last matching string
in thread REGEXP: only need last matching string

I can see NO reason why thedoe1 should be performing any better than salva's code.
salva => sub { (my $dum) = $str =~ /^.*abc\s(\d+)/s; }, thedoe1 => sub { (my $dum) = $str =~ /(?<!abc).*abc\s(\d+)/gs; },
Those regexes are equivalent. In fact, I can't understand why in the world thedoe used a look-behind there. It accomplishes nothing, since the first place the regex tries to match is at the beginning of the string. The only difference that it could make is if pos($str) is something other than 0, and then that means it would not necessary operate properly (insofaras what was requested from the regex). Sorry to sound grumpy, but this is a misuse of a look-behind (and the /g modifier) that I think should be pointed out. There's no voodoo going on.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart