# 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)
print(document)
Remove all single characters with Space that we specify in regex expression
0 Comments