regex help

Christopher Subich spam.csubich+block at block.subich.spam.com
Wed Aug 10 23:11:05 EDT 2005


jeff sacksteder wrote:
> Regex questions seem to be rather resistant to googling.
> 
> My regex currently looks like - 'FOO:.*\n\n'
> 
> The chunk of text I am attempting to locate is a line beginning with
> "FOO:", followed by an unknown number of lines, terminating with a
> blank line. Clearly the ".*" phrase does not match the single newlines
> occuring inside the block.

Include the re.DOTALL flag when you compile the regular expression.



More information about the Python-list mailing list