#!/usr/bin/ruby
txt='14:Mar:2019 "This is an Example!"'
re1='.*?'
re2='(?:(?:[0-2]?\\d{1})|(?:[3][01]{1}))(?![\\d])'
re3='.*?'
re4='(?:(?:[0-2]?\\d{1})|(?:[3][01]{1}))(?![\\d])'
re5='((?:(?:[0-2]?\\d{1})|(?:[3][01]{1})))(?![\\d])'
re6='.*?'
re7='a'
re8='.*?'
re9='(a)'
re=(re1+re2+re3+re4+re5+re6+re7+re8+re9)
m=Regexp.new(re,Regexp::IGNORECASE);
if m.match(txt)
day1=m.match(txt)[1];
w1=m.match(txt)[2];
puts "("<<day1<<")"<<"("<<w1<<")"<< "\n"
end
|