Regular Expression - newbie question

SK skunix at
Wed Aug 21 18:52:39 CEST 2002

I tried with the following code. It didn't work. Am I missing something?

import re
data = open("c.txt","rb").read()
print re.findall("^.*python output[\000-\377]*^.*?Hello World[\000-\377].*$",data)


"Raymond Hettinger" <python at> wrote in message news:<ajvd5u$ln0$1 at>...
> Try something like this:
> re.findall("^.*python output[\000-\377]*^.*?Hello World[\000-\377].*$",
> data)
> Note the question mark added after the star to make the middle part
> non-greedy.
> Raymond Hettinger

More information about the Python-list mailing list