【发布时间】:2019-12-06 18:11:38
【问题描述】:
我正在使用ng-pattern:
<input type="text" ng-model="price" name="price_field" ng-pattern-restrict="/^[4]*$/" required only-digits>
请让我知道该怎么做,它不接受除 4 之外的任何其他数字。我正在使用仅数字的指令。
【问题讨论】:
-
你的意思是
/^4$/吗?为什么不在代码中检查 4? -
或使用
/^4+$/1 次或多次 4
标签: html angularjs regex ng-pattern