sorry I actually used<br>t=re.search('(\d+)','-2.80 98\n').groups()<br><br>and this works in python. but still not in pyrex. <br><br>Yuan<br><br><div><span class="gmail_quote">On 5/2/06, <b class="gmail_sendername">Helmut Jarausch
</b> <<a href="mailto:jarausch@igpm.rwth-aachen.de">jarausch@igpm.rwth-aachen.de</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
On 2 May, Yuan Mang wrote:<br>> Hi,<br>><br>> I need to use the python re module in a pyrex module but found the pattern<br>> matching always return a None value.<br>> I insert the following test to the module file,
<br>><br>> t=re.search('\d+','-2.80 98\n').groups()<br>><br>> and when I imported the compiled module, it said "AttributeError:<br>> 'NoneType' object has no attribute 'groups'". Has anyone else<br>
> met this problem before or should I do something special to use the re<br>> module? Thanks in advance.<br>><br><br>This doesn't work in Python either<br><br>Try<br><br>import re<br>Regexp=re.compile('\d+')<br>print
re.search(Regexp,'-2.80 98\n').group(0)<br><br><br>--<br>Helmut Jarausch<br><br>Lehrstuhl fuer Numerische Mathematik<br>RWTH - Aachen University<br>D 52056 Aachen, Germany<br><br></blockquote></div><br>