I tried a regular expression to validate a number with or without decimal with maximum 2 places.
I did this
var patt= /(^\d+[.]?\d{1,2}+$)/g;
It is working in RegExr application.
but in chrome there is an error
SyntaxError: Invalid regular expression: /(^\d+[.]?\d{1,2}+$)/: Nothing to repeat
what wrong am I doing in this? Please help.Thanks.
Try this regexp:
What made your regexp incorrect is
+sign after{1,2}.