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+$