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