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