Re: small problem with re.sub

2008-01-30 Thread Gabriel Genellina
En Thu, 31 Jan 2008 01:01:30 -0200, Astan Chee <[EMAIL PROTECTED]> escribió: > I have a html text stored as a string. Now I want to go through this > string and find all 6 digit numbers and make links from them. > Im using re.sub and for some reason its not picking up the previously > matched cond

Re: small problem with re.sub

2008-01-30 Thread Mark Tolonen
"Astan Chee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I have a html text stored as a string. Now I want to go through this > string and find all 6 digit numbers and make links from them. > Im using re.sub and for some reason its not picking up the previously > matched

Fwd: small problem with re.sub

2008-01-30 Thread Sergio Correia
See this: http://www.regular-expressions.info/python.html (the Search and Replace part) You are referring to the group as "(?P=id)", when you should be using r"\g". HTH, Sergio On Jan 30, 2008 10:01 PM, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a html text stored as a string. Now I w

small problem with re.sub

2008-01-30 Thread Astan Chee
Hi, I have a html text stored as a string. Now I want to go through this string and find all 6 digit numbers and make links from them. Im using re.sub and for some reason its not picking up the previously matched condition. Am I doing something wrong? This is what my code looks like: htmlStr = r