[pyar] REGEX unicode

Angel Java Lopez ajlopez2000 en gmail.com
Jue Mar 6 15:14:14 ART 2014


Un albur, probaria en lugar de poner (.)
poner alguna de estas
(.+)
[^0-9]+




On Thu, Mar 6, 2014 at 3:00 PM, Sebastian Bassi <sebastian.bassi en globant.com
> wrote:

> 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\u03b2and 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.
>
>
> _______________________________________________
> pyar mailing list pyar en python.org.ar
> http://listas.python.org.ar/listinfo/pyar
>
> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>
> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20140306/346914e2/attachment.html>


More information about the pyar mailing list