in reply to ultimate date check regexp
use Regexp::Assemble; use Date::Calc; my $re = Regexp::Assemble->new; for my $y ( 1900 .. 2100 ) { for my $m ( 1 .. 12 ) { for my $d ( 1 .. 31 ) { if ( Date::Calc::check_date( $y, $m, $d ) ) { $re->add( sprintf( "^%4d.%02d\.%02d\$", $y, $m, $d ) ); } } } } print $re;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ultimate date check regexp
by davorg (Chancellor) on Oct 30, 2006 at 09:35 UTC | |
by borisz (Canon) on Oct 30, 2006 at 09:53 UTC |