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.
10進値(x)が次のとおりであるかどうかを検証するための正規表現検証式を探しています:0.0 <= x <= 1.0
小数点以下1桁のみが許可されます。どうすればいいのですか?
ありがとう
これを試してみてください。他の提案されたバリアントの代わりに小数点以下1桁がチェックされます
^((0\.[0-9]{1})|(1\.0))$
正規表現は次のようになります。
^(:?(:?0\.[0-9])|(:?1\.0))$
しかし、10進数の比較を使用してみませんか?