[Tutor] again... regular expression
lmac
lopoff at gmx.net
Mon Nov 21 16:23:35 CET 2005
Hallo.
I want to parse a website for links of this type:
http://www.example.com/good.php?test=anything&egal=total&nochmal=nummer&so=site&seite=22">
---------------------------------------------------------------------
re_site = re.compile(r'http://\w+.\w+.\w+./good.php?.+">')
for a in file:
z = re_site.search(a)
if z != None:
print z.group(0)
---------------------------------------------------------------------
I still don't understand RE-Expressions. I tried some other expressions
but didn't get it work.
The End of the link is ">. So it should not be a problem to extract the
link but it is.
Thank you for the help.
mac
More information about the Tutor
mailing list