Re: f*cking re module
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: f*cking re module

From: Simon Brunning <simon.brunning@gmail.com>
Date: Wed Jul 06 2005 - 11:16:59 CEST

On 6 Jul 2005 01:01:34 -0700, Raymond Hettinger <python@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@brunningonline.net,
http://www.brunningonline.net/simon/blog/
Received on Thu Sep 29 16:47:05 2005