First, I am aware that it has been asked here, but it is really old so the bug might be fixed. Here is my question:
I am writing a program to remove all symbols from a string. Here is my code:
text = input("Enter some text ")
symbols = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '-', '=', '{', '}', '|', '[', ']', ':', '\\', '"', ';', "'", '<', '>', '?', ',', '.', '/']
text = re.sub("|".join(symbols), "", text)
print(text)
When I run this, I get re.error: nothing to repeat at position 14
. Anybody know how to fix this?