Re and Me.

Emile van Sebille emile at
Sat Aug 25 13:51:22 CEST 2001

Check out

import re
p = re.compile('url=(\w)&', re.IGNORECASE)
print p.findall("""this is url=a& test
this is URL=b& test
this is url=c& test
this is Url=D& test""")


Emile van Sebille
emile at

"epoch7" <epoch7 at> wrote in message
news:toevhkp1hlem92 at
> This is day 2 of my programming expereience, so please bear with my
> newbie-ishness.
> I'm trying to search for a string inside a file.  The string will be
> different
> but the characters marking its beginning and end are the same (url= and
> I've spent all day and night just learning the ins and outs of python so
> this is still a little beyond me.
> re.split() would return the values between just one pattern correct? So
> there must be some other way.
> I could put an if statement in there that if it finds "&" it would output
> that string to file and continue with the search
> but that waaay beyond me :)
> will

More information about the Python-list mailing list