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