In article <mailman.41.1313479583.27778.python-list at python.org>, Chris Rebert <clp2 at rebertia.com> wrote: > pat = re.compile("^ *(\\([^)]+\\))", re.MULTILINE) First rule of regexes in Python is to always use raw strings, to eliminate the doubled backslashes: > pat = re.compile(r"^ *(\([^)]+\))", re.MULTILINE) Is easier to read.