in reply to Re^5: Regex troubles...
in thread Regex troubles...
If I put the for-loop back into the unrolled loop code, I start to see weird stuff again (still Strawberry 5.14.4.1):
What Perl version are you using?c:\@Work\Perl\monks>perl -wMstrict -le "for my $string (qw(ab1b2b3b4d ab5b6b7d ab8b9d abxd ad)) { my @two; my @matches = $string =~ /(a) (?: (b.) (?{ push @two, $2 }))+ (d)/x; print qq{'$string' -> all:(@matches) -> 2:(@two)}; } " 'ab1b2b3b4d' -> all:(a b4 d) -> 2:(b1 b2 b3 b4) 'ab5b6b7d' -> all:(a b7 d) -> 2:() 'ab8b9d' -> all:(a b9 d) -> 2:() 'abxd' -> all:(a bx d) -> 2:() 'ad' -> all:() -> 2:()
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Regex troubles...
by choroba (Cardinal) on Apr 23, 2016 at 20:32 UTC | |
by AnomalousMonk (Archbishop) on Apr 23, 2016 at 21:56 UTC | |
|
Re^7: Regex troubles...
by Anonymous Monk on Apr 23, 2016 at 20:20 UTC | |
|
Re^7: Regex troubles...
by Anonymous Monk on Apr 23, 2016 at 20:29 UTC |