Subject: | false 'failed' |
Hello,
I'm sorry I'm not good at English.
At first, thank you very much for this fantastic module.
When I tested this matching:
my $str = '"hello \"baby\""';
print "match\n" if ( $str =~ /"(?:[^"\\]++|\\.)*+"/ );
(this regexp is an example of possessive quantifier in perlretut document)
It succeeds matching and prints "match\n".
However, with Regexp::Debugger or rxrx, it says "Regex failed to match"
Here is event log:
"hello \"baby\" | "(?:[^"\\]++|\\ | Starting regex match
hello \"baby\"" | (?:[^"\\]++|\\. | Starting non-capturing group
hello \"baby\"" | |\\.)*+" | Trying next alternative
(It should try the first alternative but it seems to skip it.)
hello \"baby\"" | \\.)*+" | Trying an escaped literal
hello \"baby\"" | \\.)*+" | Failed
| <~~~~~~~~~~~~~ | Back-tracking in regex
(omit)
| <~~~~~~~~~~~~~ | Back-tracking in regex
| "(?:[^"\\]++|\\ | Back-tracked and restarting regex
match
| | Regex failed to match after 39 steps
I changed the regexp into /"(?:[^\\"]++|\\.)*+"/.
(swapped \\ and " in the character class)
And then the module said "Regex matched", as expected.
Would you please check it?
Thank you.
Geunyoung Park from South Korea.