Decimal or numeric values in regular expression validation

前端 未结 10 1359
礼貌的吻别
礼貌的吻别 2020-11-22 15:09

I am trying to use a regular expression validation to check for only decimal values or numeric values. But user enters numeric value, it don\'t be first digit \"0\"

10条回答
  •  一生所求
    2020-11-22 15:56

    /([0-9]+[.,]*)+/ matches any number with or without coma or dots

    it can match

             122
             122,354
             122.88
             112,262,123.7678
    

    bug: it also matches 262.4377,3883 ( but it doesn't matter parctically)

提交回复
热议问题