You shouldn't be asking questions about using Python on python-dev -- this list is for development of Python.

Your problem is easily explained however: the second argument to p.findall() should be an offset, not a flag set. (You are confusing re.findall() and p.findall().)


On Fri, May 21, 2010 at 4:32 PM, Lu, Hongchao (UI Health Care) <> wrote:

Hi All,

     I am working on a script to use re.findall,

But the result seems wield.


import re








for m in p.findall(pirfile,re.M):

        print m






The first result is missing some characters, Could you explain why? Any wrong with the script?

I tried Python2.4/2.6/2.7, the result is same.

Thank you.

Hongchao Lu

Python-Dev mailing list

--Guido van Rossum (