re.match and non-alphanumeric characters

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Nov 16 12:08:06 EST 2008


En Sun, 16 Nov 2008 14:33:42 -0200, The Web President  
<mattia.landoni at gmail.com> escribió:

> I have a string that contains some numeric data. I want to isolate
> these data using re.match, as follows.
>
> bogus = "IFC(35m)"
> data = re.match(r'(\d+)',bogus)
> print data.group(1)
>
> I would expect to have "35" printed out to screen, but instead I get
> an error that the regular expression did not match:

http://docs.python.org/library/re.html#matching-vs-searching

-- 
Gabriel Genellina




More information about the Python-list mailing list