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