python remove all non alphabetic characters code example
Example 1: python remove non letters from string
def nospecial(text):
import re
text = re.sub("[^a-zA-Z0-9]+", "",text)
return text
Example 2: remove alphabetic characters python
numeric_answer = filter(str.isdigit, original_string)
numeric_answer = "".join(numeric_answer)
Example 3: python string exclude non alphabetical characters
regex = re.compile('[,\.!?]') #etc.