RE

Guy Bashan bashan at newmail.net
Wed Jan 2 23:33:24 CET 2002


Hello, I'm new to Python and having some Regular expressing problems:
I want to find a pattern in HTML page. I have the HTML page in a variable
named data.
Now I would like to search a pattern that starts with:
-----------------------------------------------
<a href="http://news.walla.co.il/ts.cgi?tsscript=item&path=&id=163799"
class="w2b" style="color: #660000;"><span dir=rtl>
------------------------------------------------------
and ends with:
</span></a></td>

in the middle there can be any occurence.

I wrote:

result = re.search(r'style="color: #660000;"><span
dir=rtl>.*</span></a></td>', data);
if result:
    print result.group();
else:
    print 'no match';

but it seems like it doesn't work.

Anyone has ideas ???

Thanks.
Bashan.





More information about the Python-list mailing list