f*cking re module

Simon Brunning simon.brunning at gmail.com
Wed Jul 6 05:16:59 EDT 2005


On 6 Jul 2005 01:01:34 -0700, Raymond Hettinger <python at rcn.com> wrote:
> With * being a greedy operator, your post's subject line matches,
> "firetrucking"

Nope:

>>> print re.match('f*cking', 'firetrucking')
None

The OP was clearly showing his lack of regex nouce here. Clearly he
wanted 'f.*cking':

>>> print re.match('f.*cking', 'firetrucking')
<_sre.SRE_Match object at 0x01196058>

;-)

-- 
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list