I am adding a validation on a text box for decimal number (4,2). i tried below code, it works after the decimal point (meaning it's restricting user inputing more than 2 digits after decimal point) but it doesn't restrict user inputing more than 4 digits before the decimal point.
ng-pattern-restrict="^[0-9]{0,4}+(.[0-9]{0,2})?$"
- Valid input: 10.20
- Valid input: 1234.23
- Invalid input: 123456.23
- Invalid input: 1234.23456