[Tutor] re module- puzzling results when matching money

Dominik George nik at naturalnet.de
Sun Aug 4 09:43:09 CEST 2013


Hi,

not quite. The moral is to learn about greedy and non-greedy matching ;)!

-nik



Alex Kleider <akleider at sonic.net> schrieb:
>On 2013-08-03 13:38, Dominik George wrote:
>> Hi,
>> 
>>  b is defined as all non-word characters, so it is the complement oft
>> w. w is [A-Za-z0-9_-], so b includes $ and thus cuts off your <sign>
>> group.
>> 
>>  -nik
>
>I get it now.  I was using it before the '$' to define the beginning of
>
>a word but I think things are failing because it detects an end of
>word.
>Anyway, the moral is not to use it with anything but \w!
>
>Thanks!

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130804/7b1ab0fa/attachment.html>


More information about the Tutor mailing list