Answers for "python string exclude non alphabetical characters"

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 "python string exclude non alphabetical characters"

Python Answers by Framework

Browse Popular Code Answers by Language