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.
以上就是Regex error:nothing to repeat的详细内容,更多请关注web前端其它相关文章!