re behaving strangely

Josh Close narshe at gmail.com
Thu Jun 9 14:37:26 EDT 2005


Thanks for pointing out my utter stupidity :)

It's been a long day.

-Josh

On 6/9/05, Peter Hansen <peter at engcorp.com> wrote:
> Josh Close wrote:
> > This is not returning a match
> >
> > re.compile( r'b' ).search( 'back', re.I )
> >
> > Anyone know why this is?
> 
> Yes:
>  >>> import re
>  >>> re.compile(r'b').search('back', re.I)
>  >>> re.compile(r'b').search('back')
> <_sre.SRE_Match object at 0x00AF3D78>
>  >>> re.compile(r'b', re.I).search('back')
> <_sre.SRE_Match object at 0x00AF3CD0>
>  >>> re.compile(r'b', re.I).search('KCAB')
> <_sre.SRE_Match object at 0x00AF3DB0>
> 
> :-)
> 
> -Peter
> --
> http://mail.python.org/mailman/listinfo/python-list
> 


-- 
-Josh



More information about the Python-list mailing list