while ($sbNumHost1 !~ m/^(SB)(\d{1,2})$/i) { print "Enter the SB## \t: "; chomp($sbNumHost1 = ReadLine(0)); } print "done\n";