if ( m/^(\d+)(?(?{ $^N < $min || $^N > $max })(?!))$/ ){ print "$_ is between $min and $max\n"; }