Chrome Extension

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
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
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?
0 Comments
Join Devsheet Ask a Question