Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular expression validation error

I'm using regex for validating numbers in angularjs. But my code shows validation error when the number exceeds 9 digits.Could someone please help me to rectify my code such that any digits of number can be entered.

What I have tried is :

ng-pattern="/^\d{0,9}?$/"
like image 697
anju Avatar asked Jan 06 '23 14:01

anju


1 Answers

Just remove the {0,9}? and use * instead like

/^\d*$/

{0,9} mean is any length between 0 and 9

like image 57
scokmen Avatar answered Jan 16 '23 00:01

scokmen