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