Return to Snippet

Revision: 22631
at January 17, 2010 11:27 by magicrebirth


Initial Code
>>> s
'1/Mar/1215'
>>> pattern = r"(\d+)"
>>> re.match(pattern, s).groups()
('1',)
>>> pattern = r"(\d+)/(Sept|Mar)/(\d+)"
>>> re.match(pattern, s).groups()
('1', 'Mar', '1215')

Initial URL


Initial Description


Initial Title
Python: simple REgex  example

Initial Tags
regex

Initial Language
Python