Regex: how to only allow integers greater than zero

后端 未结 6 992
失恋的感觉
失恋的感觉 2021-01-20 00:42

I have tried the following to only allow integers in my text box, this works great but it allows a zero in there. Is there anything else I can add to prevent a zero being ad

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-20 01:09

    ^(\d{2}[1-9])$
    

    matches with: from 001 to 999 example 001 099 999

    does not match 000 01 0

提交回复
热议问题