Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个正则表达式来验证整数。05 and 00不允许但0被允许。目前我有这个:
05 and 00
0
/^[1-9]\d*$/
但它不允许0。感谢帮助。
^(?:[1-9]\d*|0)$
这是你的模式...
你的正则表达式应该是^(?!0.)\d+$
^(?!0.)\d+$