Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Problem with regex wildcard operator (.)...?by AnomalousMonk (Archbishop) |
on Sep 06, 2021 at 06:31 UTC ( [id://11136495]=note: print w/replies, xml ) | Need Help?? |
A note on usage. The tr/// operator does not have [...] character classes like regexes (as might be used in s///), but only ranges, e.g., a-z, so the \[ [ ] sequences in the tr/\[A-Z]/[a-z]/ expression in the OP represent literal [ ] characters (see tr/// in Quote-Like Operators in perlop). So '[' is being translated to '[' and ']' to ']'. This does no harm (indeed, the tr/// compiler may optimize this away), but suggests a misunderstanding of tr///.
And since the tr/// is just translating upper case to lower, a simple Update: I see now that Marshall has already made this point at the end of this post. Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|