I'm following the accepted answer in this link: Replace all words from word list with another string in python
Despite following the code exactly as describe in the above solution, I can't seem to remove the characters from my string. I am not receiving any errors in the console. Could anybody point out what I am doing wrong? Here is a reproducible example. Thank you.
example = "(-) This is an example of a string € which is + not being cleaned // correctly"
prohibited_strings = ["(-)","€","+","//"]
regex_cleaner = re.compile(r'\b%s\b' % r'\b|\b'.join(map(re.escape, prohibited_strings)))
example = regex_cleaner.sub("", example)