151
rated 0 times
[
158]
[
7]
/ answers: 1 / hits: 18914
/ 8 Years ago, sun, april 3, 2016, 12:00:00
I was very surprised that I didn't find this already on the internet.
is there's a regular expression that validates only digits in a string including those starting with 0 and not white spaces
here's the example I'm using
function ValidateNumber() {
var regExp = new RegExp(/^d+$/);
var strNumber = 010099914934;
var isValid = regExp.test(strNumber);
return isValid;
}
but still the isValid value is set to false
More From » regex