Mega Code Archive

 
Categories / Python Tutorial / Regular Expressions
 

Re findall returns a list of all occurrences of the given pattern

import re pat = '[a-zA-Z]+' text = '"Hm Err -- are you sure?" he said, sounding insecure.' print re.findall(pat, text)