if ($_ =~ /\something(\d*)somethingelse/i){ if($1 => 1 and $1 <= 75) { ... } }