I want to provide alternative replacement patterns to re.sub.
Let\'s say i\'ve got two search patterns as alternatives, like this:
re.sub(r\"[A-Z]+|[
Usually, you would just use two replacements:
re.sub(r"[A-Z]+", replacement1, string) re.sub(r"[a-z]+", replacement2, string)
Anticlimactic, right?
It's actually less code than the alternatives usually, and it's far clearer what you're doing.