I want the regular expression to check a form input. If the first digit of the 10 digit number is 0, it should prompt an alert
I wrote this code - but it is giving the alert if any of the 10 digits is 0.
Please suggest the regular expression for this.
regards
Code: Select all
x.toString().match(/^0*/) ) { alert("number must not start with zero"); return false; }