regex to validate double values

前端 未结 2 1162
自闭症患者
自闭症患者 2021-01-27 03:55

I\'m trying to come up with a regex to validate a double value. I will admit that I am crap at regex and really should buy a book... Anyway the range is large so here goes:

2条回答
  •  花落未央
    2021-01-27 04:20

    ^[0-9]{0,2}\.?[0-9]{0,2}$
    

    you can try it out here: http://www.regular-expressions.info/javascriptexample.html

提交回复
热议问题