Mega Code Archive
Categories
/
Python Tutorial
/
Regular Expressions
Find the punctuation
import re text = '"Hm Err -- are you sure?" he said, sounding insecure.' pat = r'[.?\-",]+' print re.findall(pat, text)