python
Python - regex,replace all character exept A-Z a-z and numbers
# Remove all the special characters
# replace all character exept A-Z a-z
import re
text = "That is a # ; '' 2 45 6 ?/..,,, test for removing multiple spaces"
document = re.sub(r'W', ' ', text)
print(document) # as we can see this regex expresion do not remove numbers
Output
That is a 2 45 6 test for removing multiple spaces
As we can see this regex expression do not remove numbersÂÂ
Was this helpful?
Similar Posts
- Python - regex , remove all single characters,replace all single chars,char
- Python - String ,remove,delete,replace,extract numbers from string
- Python - regex , replace multiple spaces with one space
- Python - String, renove all single character for text
- Replace all spaces with hyphens in Python
- Validate password with and without regex in Python
- Convert multiple spaces of a string to single space in python [with and without regex]