A plain .* will make the pattern match skip the bug we
are testing for. We need .*? to see the difference
Fixed:
./perl -Ilib -le'"riiaan"=~/(.*?(a(a)|i(i))n)/ and print "$2-$3-$4-$1"'
aa-a--riiaan
Broken:
perl -le'"riiaan"=~/(.*?(a(a)|i(i))n)/ and print "$2-$3-$4-$1"'
aa-a-i-riiaan
Maybe the test could make this more explicit. Not sure if its
worth it.
Thanks to Aaron Crane for noticing the test didn't do what it was
meant to. Bad Yves.
(?:\1|a)([bcd])\1(?:(?R)|e)\1 abbaccaddedcb y $& abbaccaddedcb # [perl 128420] recursive match with backreferences
AB\s+\x{100} AB \x{100}X y - -
\b\z0*\x{100} .\x{100} n - - # [perl #129350] crashed in intuit_start
-(.*(a(a)|i(i))n) riiaan y $2-$3-$4-$1 aa-a--riiaan # Jump trie capture buffer issue [perl #129897]
+(.*?(a(a)|i(i))n) riiaan y $2-$3-$4-$1 aa-a--riiaan # Jump trie capture buffer issue [perl #129897]
(^(?:(\d)x)?\d$) 1 y [$1-$2] [1-] # make sure that we reset capture buffers properly (from regtry)
# Keep these lines at the end of the file