[pyar] Expresiones regulares y el "Matches if ... doesn’t match next"

Roberto Alsina ralsina en netmanagers.com.ar
Sab Nov 13 22:40:29 ART 2010


On Saturday 13 November 2010 22:11:56 N Cis wrote:
> Osea, no entiendo como hacer que ignore cuando el "/" esta presente.
> 
> Alguna ayuda?.

>>> archivo = "<img src='hola'/>"
>>> re.sub("(<img.*?')>", '\g<1>/>', archivo)
"<img src='hola'/>"
>>> archivo = "<img src='hola'>"
>>> re.sub("(<img.*?')>", '\g<1>/>', archivo)
"<img src='hola'/>"



More information about the pyar mailing list