Answers for "how to remove all non alphabetic characters python"

3

python remove non letters from string

def nospecial(text):
	import re
	text = re.sub("[^a-zA-Z0-9]+", "",text)
	return text
Posted by: Guest on May-31-2020
0

python string exclude non alphabetical characters

import re

regex = re.compile('[^a-zA-Z]')
#First parameter is the replacement, second parameter is your input string
regex.sub('', 'ab3d*E')
#Out: 'abdE'
Posted by: Guest on February-28-2021
0

python string exclude non alphabetical characters

regex = re.compile('[,.!?]') #etc.
Posted by: Guest on February-28-2021

Code answers related to "how to remove all non alphabetic characters python"

Python Answers by Framework

Browse Popular Code Answers by Language