#!/usr/bin/python
import re
txt='08:Nov:2018 "This is an Example!"'
re1='((?:(?:[0-2]?\\d{1})|(?:[3][01]{1})))(?![\\d])'
re2='.*?'
re3='(?:[a-z][a-z]+)'
re4='.*?'
re5='((?:[a-z][a-z]+))'
rg = re.compile(re1+re2+re3+re4+re5,re.IGNORECASE|re.DOTALL)
m = rg.search(txt)
if m:
day1=m.group(1)
word1=m.group(2)
print "("+day1+")"+"("+word1+")"+"\n"
|