How can I make a regular expression to validate that in the textbox enter a maximum of 19 digits and a minimum of 15?
What I have is this ER but I think it's wrong
var expreg = /^([0-9])*{0,25}$/;
How can I make a regular expression to validate that in the textbox enter a maximum of 19 digits and a minimum of 15?
What I have is this ER but I think it's wrong
var expreg = /^([0-9])*{0,25}$/;
Your Expression is wrong in *
.
Then your expression should look like this:
var expreg = "^([0-9]){15,19}$";
What makes *
take no value to infinity, so if you want a minimum and a maximum you specify it in {min,max}
I leave this regexpal website for validation of regular expressions and this another web of regex101 more complete than commented @DanielFaro.