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