Has it been resolved? That is, what is the definitive expected behavior/precedence wrt/ \Q\E and #?
Does the documentation need clarifying?
Update:
Just reran the example above on 5.10.1, still get the \E in the output:
use YAPE::Regex::Explain; $regex1 = qr{\QHello# World\E}x; $parser1 = YAPE::Regex::Explain->new($regex1)->explain; print "$parser1\n"
produces:
The regular expression: (?x-ims:Hello\#\ World\\E) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?x-ims: group, but do not capture (disregarding whitespace and comments) (case-sensitive) (with ^ and $ matching normally) (with . not matching \n): ---------------------------------------------------------------------- Hello 'Hello' ---------------------------------------------------------------------- \# '#' ---------------------------------------------------------------------- \ ' ' ---------------------------------------------------------------------- World 'World' ---------------------------------------------------------------------- \\ '\' ---------------------------------------------------------------------- E 'E' ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------
And perlre for 5.10.1 says:
The # character is also treated as a metacharacter introducing a comment, just as in ordinary Perl code. This also means that if you want real whitespace or # characters in the pattern (outside a character class, where they are unaffected by /x), then you'll either have to escape them (using backslashes or \Q...\E ) or encode them using octal or hex escapes.The 5.18 version is essentially the same.
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re: Weird quoting with /x modifier
by QM
in thread Weird quoting with /x modifier
by ykar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |