On Mar 31, 9:12 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the following regular expression.
> It works when 'data' contains the pattern and I see 'match2' get print
> out.
> But when 'data' does not contain pattern, it just hangs at
> 're.findall'
>
> pattern = re.compile("(.*)<img (.*?) src=\"(.*?)img(.*?)\"(.*?)",
> re.S)
>
>         print "before find all"
>
>         match = re.findall(pattern, data)
>
>         if (match):
>            print "match2"
>
> Can you please tell me why it that?

It doesn't hang when I try it.  Why don't you post a complete example
that hangs.

Also, you might consider using exterior single quotes around your
string so that you don't have to escape double quotes inside the
string.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to