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.
In reply to Re^2: Regex bug? (/u not cooperating with /x) (string vs regex)
by mrpeabody
in thread Regex bug? (/u not cooperating with /x)
by mrpeabody
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |