#!/usr/bin/perl # vim: set ts=4 sw=4 et sta: use strict; use warnings; my @datum = qw( 12.01.2006 23.11.06 23.23.222 ); for ( @datum ) { if ( m!\b\d\d?\.\d\d?\.(?:\d\d){1,2}\b! ) { print "$_ : match\n"; } else { print "$_: no match\n"; } }