On Wed, 2007-09-26 at 12:49 -0400, Steve Holden wrote:
> james_027 wrote:
> > hi,
> > 
> > how do I regex that could check on any of the value that match any one
> > of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug',
> > 'sep', 'oct', 'nov', 'dec'
> > 
> > Thanks
> 
>  >>> patr = re.compile('jan|feb|mar|apr|may|jun|jul|aug|sep|nov|oct|dec')
>  >>> patr.match("jul")
> <_sre.SRE_Match object at 0x7ff28ad8>
>  >>> patr.match("nosuch")

Unfortunately, that also matches margarine, mayonnaise, and octopus,
just to name a few ;-)

-- 
Carsten Haese
http://informixdb.sourceforge.net


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to