I need to split strings of data using each character from string.punctuation and string.whitespace as a separator.
string.punctuation
string.whitespace
Furthermore, I need for the
My take:
from string import whitespace, punctuation import re pattern = re.escape(whitespace + punctuation) print re.split('([' + pattern + '])', 'now is the winter of')