[Tutor] Regex across multiple lines

Frank Moore francis.moore at rawflow.com
Wed Apr 26 13:46:41 CEST 2006


Kent Johnson wrote:

>Use your compiled regex for the sub(), so it will have the DOTALL flag set:
>html_text = p.sub(replace_string, html_text)
>  
>
Kent,

I was trying to work out how to use the DOTALL flag with the sub method, 
but couldn't figure it out.
It's so obvious once someone points it out. ;-)

Many thanks,
Frank





More information about the Tutor mailing list