#!/usr/bin/perl
$txt='11:Feb:2019 "This is an Example!"';
$re1='.*?';
$re2='((?:(?:[1]{1}\\d{1}\\d{1}\\d{1})|(?:[2]{1}\\d{3})))(?![\\d])';
$re3='.*?';
$re4='(an)';
$re=$re1.$re2.$re3.$re4;
if ($txt =~ m/$re/is)
{
$year1=$1;
$word1=$2;
print "($year1) ($word1) \n";
}
|