Re: Regex y grouping

Arnau Sanchez <[email protected]>
Newsgroups gmane.comp.python.general.castellano
Message-ID <[email protected]>
Ferran Fontcuberta wrote:

> re.sub('test(\d)', func(r'\1'), 'test0')

Uhm, estás usando re.sub para capturar campos... ¿por qué no re.search o 
re.findall, según el caso?

En cualquier caso, estoy con Ricardo, manda la entrada que tienes (la parte 
importante, si es muy larga) y la salida que quieres.

 > def parseImg(img):
 > 	imgs.append(img)
 > 	return 'cid:'+img

Uf, una función de este tipo no debería tener efectos colaterales (al menos 
Alonzo Church no lo aprobaría ;-))


-- 
Desarrollador freelance
http://www.arnau-sanchez.com

_______________________________________________
Lista de correo Python-es 
http://listas.aditel.org/listinfo/python-es
FAQ: http://listas.aditel.org/faqpyes
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.