#!/usr/bin/ruby
txt='16:May:2019 "This is an Example!"'
re1='(16:May:2019)'
re2='.*?'
re3='(h)'
re4='.*?'
re5='(an)'
re=(re1+re2+re3+re4+re5)
m=Regexp.new(re,Regexp::IGNORECASE);
if m.match(txt)
ddmmmyyyy1=m.match(txt)[1];
c1=m.match(txt)[2];
var1=m.match(txt)[3];
puts "("<<ddmmmyyyy1<<")"<<"("<<c1<<")"<<"("<<var1<<")"<< "\n"
end
|