This works as long as you are using ASCII and only matching alpha characters$s = 'foo FOO Foo fOO'; $s =~ s/(foo)/$1 ^ lc($1) ^ "bar"/gie; print $s,"\n"; # outputs "bar BAR Bar bAR"
Dave.
In reply to Re: Pattern Matching: Case-Conservation
by dave_the_m
in thread Pattern Matching: Case-Conservation
by crazysniffable
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |