in reply to change [A-Z] to U, [a-z] to L with one regex?
tr is the one that does it:
The string in eval expands to the commented line above it.my $r = "SomEThingWithMIXEDRegiSter"; #$r =~ tr/[A-Z][a-z]/UUUUUUUUUUUUUUUUUUUUUUUUUULLLLLLLLLLLLLLLLLLLLLLL +LLL/; eval( '$r =~ tr/[A-Z][a-z]/'.('U' x 26).('L' x 26).'/' ); print $r;
For every complex problem there is an answer that is clear, simple, and wrong. H. L. Mencken
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: change [A-Z] to U, [a-z] to L with one regex?
by jwkrahn (Abbot) on Mar 19, 2013 at 21:22 UTC | |
by BrowserUk (Patriarch) on Mar 19, 2013 at 23:47 UTC | |
by jwkrahn (Abbot) on Mar 20, 2013 at 02:15 UTC | |
by hdb (Monsignor) on Mar 20, 2013 at 08:27 UTC |
In Section
Seekers of Perl Wisdom