in reply to Re: Regex bug? (/u not cooperating with /x) (string vs regex)
in thread Regex bug? (/u not cooperating with /x)
print "($1)($2)\n" while "ggGGGG" =~ /([a-z])\U(\1*g)/g; # (g)(gG)
\U applies to "\1", not to the "g" that it matches.
So string parsing and regex parsing are two separate stages, the operators of which look similar but take effect at different times. That makes sense. I do think that a quick note in perlre would make it less surprising.
|
|---|