I'd like to perform a search and replace regular expression which preserves the case of the word as best as possible using the following rules:
What's the best way to do this? I can think of some ugly hacks that check the case of the word, set a flag, and then adjust it afterwards. But I assume there's a better way.
Any Regexp gurus out there with good ideas?
In reply to Case-preserving regexp search and replace? by rrwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |