pixelwraith
05-23-2004, 06:31 AM
i am making calculations and want to check that the user has entered only digits and not just a leading zero or only a zero
this is what i have used
if ($answers[2] =~/\D/)
{
exit;
}
to check that only digits have been used but cant figure out how to incorporate leading zeros or only a zero
i tried
if ($answers[2] =~/\D^0/)
{
exit;
}
and a few other versions
can someone help out with the correct syntax? :)
this is what i have used
if ($answers[2] =~/\D/)
{
exit;
}
to check that only digits have been used but cant figure out how to incorporate leading zeros or only a zero
i tried
if ($answers[2] =~/\D^0/)
{
exit;
}
and a few other versions
can someone help out with the correct syntax? :)