例如:
T h e t e x t i s w h a t I w a n t t o r e p l a c e
我想要这样的结果:
The text is what I want to replace
我用 shell、sed、
echo 'T h e t e x t i s W h a t I w a n t r e p l a c e'|sed -r "s/(([a-zA-Z])\s){1}/\2/g"|sed 's/\ / /g'
它成功了。但我不知道如何在python中替换它。有人可以帮助我吗?