#!/usr/bin/perl
$txt='42 43';
$re1='.*?';
$re2='(?:(?:[0-2]?\\d{1})|(?:[3][01]{1}))(?![\\d])';
$re3='((?:(?:[0-2]?\\d{1})|(?:[3][01]{1})))(?![\\d])';
$re4='( )';
$re5='(\\d+)';
$re=$re1.$re2.$re3.$re4.$re5;
if ($txt =~ m/$re/is)
{
$day1=$1;
$c1=$2;
$int1=$3;
print "($day1) ($c1) ($int1) \n";
}
|