Regex one-to-one mapping pattern replace
- by polygenelubricants
How would you use regex to write a function that replaces all lowercase letters with uppercase and vice versa?
Note: this is NOT a homework question. See also my previous explorations of regex:
Regex split into overlapping strings (Alan Moore's answer is especially instructive)
Can you use zero-width matching regex in String split? (my solution exploits a known Java regex bug with regards to non-obvious length lookbehind!)