in reply to vallidating a regular expression

Your question is a perfect example of why you should provide a working example when asking questions on SOPW

I'm assuming you're doing something like this...

my @test_numbers = qw(1 2 5 8 10 12 14 56); foreach my $test_number (@test_numbers) { if( $test_number =~ /^\d{2}$/){ if($test_number <= 10){ print "$test_number\n"; } } }
If that assumption is correct, then as already mentioned, your single digit numbers are not passing your regex because you've mandated that there must be two characters.

this is a simple fix to the regex, combined with getting rid of your nested if statement you get the following.

foreach my $test_number (@test_numbers) { if( $test_number =~ /^\d{1,2}$/ and $test_number <= 10){ print "$test_number\n"; } } __OUTPUT__ 1 2 5 8 10
but without knowing exactly what your data was, it's hard to say if this is right for you.
---
my name's not Keith, and I'm not reasonable.