* Jose Alves de Castro <[EMAIL PROTECTED]> [2004-06-01 11:59]:
> BTW: This was made so it would work with $year consisting of
> four digits... any care to make it generic? :-)
sub rx_gt {
local $_ = shift;
return if /\D/;
my @alt = '';
for(split //) {
$_ .= '\d' for @alt[ 1 .. $#alt ];
if($_ <= 7) {
unshift @alt, $alt[0];
$alt[0] .= $_;
$alt[1] .= "[EMAIL PROTECTED] $_+1 ]}-9]";
}
elsif($_ == 8) {
unshift @alt, $alt[0];
$alt[0] .= 8;
$alt[1] .= 9;
}
else { # == 9
$alt[0] .= 9;
}
}
shift @alt;
my $rx = join '|', @alt;
return "(?:$rx)";
}
$_ = "14987345";
print map "$_\n", "$_:", rx_gt $_;
--
Gruss,
Aristoteles
"Wer nicht �ber sich selbst lachen kann, nimmt das Leben nicht ernst genug."