Not sure what you are needing this to do but the following would preserve clarity as to what was going on.
#in a loop s/[A-Z]+/REPLACE/, next; s/[a-z]+/replace/, next; s/[A-Z][a-z]+/Replace/, next;
If its simple letter translation you could of course use tr/// which would keep your cases straight.
In reply to Re: Case-preserving regexp search and replace?
by dga
in thread Case-preserving regexp search and replace?
by rrwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |