Ach has asked for the wisdom of the Perl Monks concerning the following question:
This appears to be a bug in v5.22.2 built for cygwin-thread-multi:
DB<1> $line = "\"quoted-text\" \cM\cJ" DB<2> x $line 0 "\"quoted-text\" \cM\cJ"
My original regex:
DB<3> x $line =~ m/^(\s*)((?'quote'"?)[^\s"]*\g{quote})\s+(\[[^\]]*\ +]|)\s*$/ 0 '' 1 '"quoted-text"' 2 '"' 3 ''
Remove backreference:
DB<4> x $line =~ m/^(\s*)((?'quote'"?)[^\s"]*")\s+(\[[^\]]*\]|)\s*$/ 0 '' 1 '"quoted-text"' 2 '"' 3 ''
Replaced named with unnamed group:
DB<5> x $line =~ m/^(\s*)(("?)[^\s"]*")\s+(\[[^\]]*\]|)\s*$/ 0 '' 1 '"quoted-text"' 2 '"' 3 ''
Replace unnamed group with internals of group:
DB<6> x $line =~ m/^(\s*)("?[^\s"]*")\s+(\[[^\]]*\]|)\s*$/ 0 '' 1 '"quoted-text"' 2 '' 3 ''
Needless to say, the commands 2-5 resulted in the wrong result for array element 2.
Has this been discovered and fixed yet?
Ach
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Captured single quote results in captured phantom quote
by AnomalousMonk (Archbishop) on Aug 24, 2016 at 22:45 UTC | |
by choroba (Cardinal) on Aug 25, 2016 at 07:40 UTC | |
by Ach (Initiate) on Aug 25, 2016 at 13:35 UTC | |
by AnomalousMonk (Archbishop) on Aug 25, 2016 at 13:49 UTC | |
|
Re: Captured single quote results in captured phantom quote
by sn1987a (Curate) on Aug 25, 2016 at 12:32 UTC | |
by Ach (Initiate) on Aug 25, 2016 at 13:43 UTC | |
|
Re: Captured single quote results in captured phantom quote
by Ach (Initiate) on Aug 24, 2016 at 22:07 UTC |