Chrome Extension

Python - regex , remove all single characters,replace all single chars,char

# remove all single characters
# replace all single chars,char
import re

text = "That is a           test for removing                         multiple spaces"

document = re.sub(r's+[a-zA-Z]s+', ' ', text)

Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
That is test for removing multiple spaces

Remove all single characters with Space that we specify in regex expression

Was this helpful?
Join Devsheet Ask a Question