I have a large string with brackets and commas and such. I want to strip all those characters but keep the spacing. How can I do this. As of now I am using
s
A bit faster implementation:
import re pattern = re.compile('([^\s\w]|_)+') strippedList = pattern.sub('', value)