#!/usr/bin/python
import re
txt='11:Jan:2019 "This is an Example!"'
re1='.*?'
re2='(This)'
re3='.*?'
re4='.'
re5='.*?'
re6='.'
re7='.*?'
re8='(.)'
rg = re.compile(re1+re2+re3+re4+re5+re6+re7+re8,re.IGNORECASE|re.DOTALL)
m = rg.search(txt)
if m:
word1=m.group(1)
c1=m.group(2)
print "("+word1+")"+"("+c1+")"+"\n"
|