Source Code:
(back to article)
import re my_string = "123abc#$%^&*()" new_string = re.sub(r'[^a-zA-Z]', '', my_string) print(new_string) # prints "abc"
Result:
Report an issue