RegEx swapcase()

Published by Rahul Choubey in

Define a match and a repl to create a swapcase() method.

Examples

re.sub(match, repl, "hello") ➞ "HELLO"

re.sub(match, repl, "wOw|WoW") ➞ "WoW|wOw"
# Special characters are left alone.

Notes

N/A

Watch a quick demo on how Edabit works.