Regular Expression - newbie question

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


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

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

 

"Raymond Hettinger" <python at rcn.com> wrote in message news:<ajvd5u$ln0$1 at bob.news.rcn.net>...
> 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