my $title = q(the 2000); if ($title =~/^the ( *?)\d\d\d\d$/ig) { print "\ntrigger1" #PRINTS } if ($title =~/^the ( *?)\d\d\d\d$/ig) { print "\ntrigger2" #NO PRINT }