[pyar] REGEX unicode

Sebastian Bassi sebastian.bassi en globant.com
Jue Mar 6 15:00:01 ART 2014


Necesito matchear un substring aca adentro:

(Pdb) p unicode(citation_text[:500])
u'http://breast-cancer-research.com/content/2/2/100\n\nReview\n\n\u03b2 and
breast cancer\nTransforming growth factor-\u03b2\nLessons learned from
genetically altered mouse models\nLalage M Wakefield, Yu-an Yang and Oksana
Dukhanina\nNational Cancer Institute, Bethesda, Maryland, USA\n\nReceived:
29 November 1999\nRevisions requested: 3 January 2000\nRevisions received:
21 January 2000\nAccepted: 24 January 2000\nPublished: 21 February
2000\n\nBreast Cancer Res 2000, 2:100\u2013106\n\nAbstract\nTransforming
growth factor (TGF)-\u03b2s '

Especificamente quiero levantar esta parte:

 2000, 2:100\u2013106

Que en el HTML de donde lo extraje, se ve asi:

 2000, 2:100–106
Hay un "dash largo" (o como se llame) que el REGEX no me lo marca.
Mi regex fue construido asi:
(\ )?(\ )?(\ )?(\ )?([1-9]\d*)(\,)(\ )?(\ )?(\ )?(\ )?([1-9]\d*)(\:)(\ )?(\
)?(\ )?(\ )?([1-9]\d*)(.)([1-9]\d*)

(con un generador automatico). La clave es que espero que "." me matchee
cualquier cosa, incluido el \u2013 pero evidentemente, eso no ocurre.

¿que puede ser?





-- 
Sebastián Bassi. *sebastian.bassi en globant.com <sebastian.bassi en globant.com>*
Lic. en Biotecnología con orientación en genética molecular.
Software Developer @ Globant.
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20140306/31524ffd/attachment.html>


More information about the pyar mailing list