我想这样做:3.40,不超过 3 个字符和一个点:
<md-input-container class="md-block">
<label>Marks/CGPA</label>
<input type="text" name="education.cgpa" ng-model="education.cgpa"
ng-pattern="/^[0-9]{0,4}$/">
<div class="input-validation" ng-show="educationSaveForValidate['education.cgpa'].$error.pattern">
Insert valid CGPA
</div>
</md-input-container>
如何在正则表达式中只允许 3 位数字和 1 个点?