You are viewing a single comment's thread. Return to all comments →
Maybe a bit stupid, but works :D
def replacer(matchobj): return matchobj.group(0)[0] + ' ' + matchobj.group(0)[-1] res = re.sub(r'[a-zA-Z0-9](\s*[^a-zA-Z0-9]+\s*)[a-zA-Z0-9]', replacer, text) print(res)
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Script
You are viewing a single comment's thread. Return to all comments →
Maybe a bit stupid, but works :D