Newbie question : string processing with RE

Terry Reedy tjreedy at udel.edu
Wed Mar 28 00:51:36 EST 2001


I believe the indicated changes will work.

>  f3 = urllib.urlopen ("www.such-a-nice-webpage.com/index.html",
encoded_data)

f3 = urllib.urlopen ("www.such-a-nice-webpage.com/index.html",
encoded_data).read()

>  p=re.compile("window.open")
>  q=re.compile("document.location =" )
>  print p,'\n',q
>  t1=p.search(f3.read())
>  t2=q.search(f3.read())

t1=p.search(f3)
t2=q.search(f3)







More information about the Python-list mailing list