Python script for replacing text with multiple characters

Your regexp pattern is incorrect. It should be r'[A-Z]+'.

Your current pattern matches only one character, mine matches one-or-more. Do read up on https://docs.python.org/2/library/re.html#regular-expression-syntax :slight_smile:

3 Likes