Define a match and a repl to create a swapcase() method.
match
repl
swapcase()
re.sub(match, repl, "hello") ➞ "HELLO" re.sub(match, repl, "wOw|WoW") ➞ "WoW|wOw" # Special characters are left alone.
N/A