$matches = -50;
$res = preg_match("/[1-9]{1,10}/",$matches);
print_r($res); //1
as shown in the code above, I don"t match the-sign regularly, but I can still enter a negative number. What"s going on?
how can I use regular expressions to disable the input of negative numbers.