我尝试使用此指令,但无法为两位小数设置正则表达式
如何设置正则表达式,例如允许像 34.21 这样的数字 | 32.4 | 32 | 67. | 77.
^[0-9]+(\.[0-9]{0,2})?$
测试用例:
1234 *matches*
12.23 *matches*
4343.2 *matches*
12123. *matches*
.12 *does not match*
1.234 *does not match*
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句