I have the following input field that accepts the price as a value.
input{
type="text"
name="price"
np-currency=true
ng-model='price'
ng-pattern="/[$,.]\d*$/"
}
This pattern("/[$,.]\d*$/")
makes the input field invalid for $25.34@@@C%34
which is correct however just 25 also becomes invalid thats because it does not have either $ or , or. How do I make it optional?
I need $25.00
or 25
as valid but not $25.00$%#$%%@@
.
requirement: any digits $
, ,
.
are valid
I really appreciate any suggestions on this regular expression.