my $id = '6543201'; if ( $id =~ /^[0-9]*01$/ ) { print "die ID endet auf 01 und besteht nur aus Ziffern.\n"; }