in reply to Re: regular expression help
in thread regular expression help

Here's a solution that uses the core module Time::Local
use Time::Local qw( timegm ); /(\d{4})[-\/.](\d{2})[-\/.](\d{2})/ or die("Bad format\n"); my $time = eval { timegm(0, 0, 0, $3, $2, $1) }; die("Bad date\n") if $@;
Switch timegm for timelocal if you prefer.