regex confusion

A.M. Kuchling amk at
Tue Dec 9 17:33:52 CET 2003

On Tue, 09 Dec 2003 09:43:24 -0600, 
	John Hunter <jdhunter at> wrote:
>   rgxPrev = re.compile('.*?a.*?')

. doesn't match newlines unless you specify the re.DOTALL / (?s) flag, so it
won't match unless 'a' is on the very first line.  Add (?s) to your
expression, and it should work (though it'll be much slower than the .find()


More information about the Python-list mailing list