G
Gilles Ganault
Hello
I need to iterate through a variable, and for each pattern that
matches, replace this with something else.
I read the chapter in www.amk.ca/python/howto/regex/, but the output
is wrong:
=======
#Extract two bits, and rewrite the HTML
person = re.compile('<tr onMouseOver=(?P<item1>.+?)>.+?<a
onmouseover="Tip(?P<item2>.+?) </td>')
output = person.sub('<tr onMouseOver=\1><td><a
onmouseover="Tip\2</td>', input)
=======
Does someone have a simple example handy so I can check what's wrong
with the above?
Thank you.
I need to iterate through a variable, and for each pattern that
matches, replace this with something else.
I read the chapter in www.amk.ca/python/howto/regex/, but the output
is wrong:
=======
#Extract two bits, and rewrite the HTML
person = re.compile('<tr onMouseOver=(?P<item1>.+?)>.+?<a
onmouseover="Tip(?P<item2>.+?) </td>')
output = person.sub('<tr onMouseOver=\1><td><a
onmouseover="Tip\2</td>', input)
=======
Does someone have a simple example handy so I can check what's wrong
with the above?
Thank you.