#!/usr/bin/perl
$txt='15:Mar:2019 "This is an Example!"';
$re1='((?:(?:[0-2]?\\d{1})|(?:[3][01]{1})))(?![\\d])';
$re2='.*?';
$re3='([a-z])';
$re4='.*?';
$re5='(an)';
$re=$re1.$re2.$re3.$re4.$re5;
if ($txt =~ m/$re/is)
{
$day1=$1;
$w1=$2;
$word1=$3;
print "($day1) ($w1) ($word1) \n";
}
|