匹配整数部分0-100,小数部分为2位(可选)的正则

pattern = /^((\d|[1-9]\d)(?:\.\d{1,2})?|100)$/
效果如下:

 

posted @ 2020-07-29 15:26  keqwind  阅读(644)  评论(0编辑  收藏  举报