if ($port111 =~ /^(\d{1,2})\/(\d{1,2})\/(\d{1,2})$/) {print "yes port111=$port111\n";} #### $string = 'ME170-5/2/8-ME172-2/2/6-ME4028'; @ports = $string =~ /^(\d{1,2})\/(\d{1,2})\/(\d{1,2})$/;