[Pyrex] strange behavior of re module

Yuan Mang mangyuan at gmail.com
Tue May 2 16:57:29 CEST 2006


sorry I actually used
t=re.search('(\d+)','-2.80 98\n').groups()

and this works in python. but still not in pyrex.

Yuan

On 5/2/06, Helmut Jarausch <jarausch at igpm.rwth-aachen.de> wrote:
>
> On  2 May, Yuan Mang wrote:
> > Hi,
> >
> > I need to use the python re module in a pyrex module but found the
> pattern
> > matching always return a None value.
> > I insert the following test to the module file,
> >
> > t=re.search('\d+','-2.80 98\n').groups()
> >
> > and when I imported the compiled module, it said  "AttributeError:
> > 'NoneType' object has no attribute 'groups'". Has anyone else
> > met this problem before or should I do something special to use the re
> > module? Thanks in advance.
> >
>
> This doesn't work in Python either
>
> Try
>
> import re
> Regexp=re.compile('\d+')
> print re.search(Regexp,'-2.80 98\n').group(0)
>
>
> --
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> RWTH - Aachen University
> D 52056 Aachen, Germany
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20060502/466e229b/attachment-0001.html


More information about the Pyrex mailing list