I thought \U was supposed to be an escape sequence to convert the character sequence to uppercase.It is, but it applies to the pattern, not to the string being matched. It's most useful when the pattern contains an interpolated string, eg
$ perl -le '$s = "a"; print "\U$s"' A $ perl -le '$s = "a"; print "matched a" if "a" =~ "\U$s"' $ perl -le '$s = "a"; print "matched A" if "A" =~ "\U$s"' matched A
Dave.
In reply to Re^3: regular expressions in unicode
by dave_the_m
in thread regular expressions in unicode
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |