Currently, I am working on updating a PHP script that contains the following code snippet:
function CheckNumber(MyNumber)
{
var MN = /^\d{10}$/;
if (MN.test(MyNumber)) {
return true;
}
return false;
}
The current script enforces the entry of exactly 10 digits. No more, no less.
Now, I have a requirement to modify it with the following conditions: - Must not exceed 12 digits. - Should allow less than 12 digits as well. - Special characters are not allowed.
I am seeking assistance as I am unfamiliar with regular expression coding. Your help is greatly appreciated.