Regular Expression allow null or 1 to 9 digit

后端 未结 3 1840
被撕碎了的回忆
被撕碎了的回忆 2021-01-26 07:08

I have tried to validate my input quantity field by using pattern attribute. But my regular expression not working. Please check

^(?:[1-9]\\d*|)$
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-26 07:32

    You may check by yourself:

    https://regex101.com^(?:[1-9]\d*|)$

提交回复
热议问题