# URL that generated this code:# http://txt2re.com/index-ruby.php3?s=11:Oct:2018%20%22This%20is%20an%20Example!%22&15
#!/usr/bin/ruby
txt='11:Oct:2018 "This is an Example!"'re1='.*?'# Non-greedy match on fillerre2='((?:(?:AL)|(?:AK)|(?:AS)|(?:AZ)|(?:AR)|(?:CA)|(?:CO)|(?:CT)|(?:DE)|(?:DC)|(?:FM)|(?:FL)|(?:GA)|(?:GU)|(?:HI)|(?:ID)|(?:IL)|(?:IN)|(?:IA)|(?:KS)|(?:KY)|(?:LA)|(?:ME)|(?:MH)|(?:MD)|(?:MA)|(?:MI)|(?:MN)|(?:MS)|(?:MO)|(?:MT)|(?:NE)|(?:NV)|(?:NH)|(?:NJ)|(?:NM)|(?:NY)|(?:NC)|(?:ND)|(?:MP)|(?:OH)|(?:OK)|(?:OR)|(?:PW)|(?:PA)|(?:PR)|(?:RI)|(?:SC)|(?:SD)|(?:TN)|(?:TX)|(?:UT)|(?:VT)|(?:VI)|(?:VA)|(?:WA)|(?:WV)|(?:WI)|(?:WY)))(?![a-z])'# US State 1re=(re1+re2)
m=Regexp.new(re,Regexp::IGNORECASE);
if m.match(txt)
usstate1=m.match(txt)[1];
puts "("<<usstate1<<")"<< "\n"
end
#-----# Paste the code into a new ruby file.# $ ruby x.ruby#-----