I am trying to validate the user input of a text field using e-pattern from the angular-xeditable directive. I have built the regular expression using an online regex builder/tester and it does exactly what I want however angular-xeditable doesn't seem to recognize the expression as being valid. It shows the below even when the expression is valid.
requirements:
valid entry: 0.5, 0.95, 0.40, 1.0
regex:
^((0+(\.[0-9][05]?))|1+(\.0))$
code:
<span e-pattern="/^((0+(\.[0-9][05]?))|1+(\.0))$/" e-required ng-show="!tableform.$visible" editable-text="user.available" e-form="tableform" onbeforesave="checkAvailable($data)">{{ user.available}} </span>
message:
Is there anything I'm missing or need to amend to the expression or span tag?
Fail, I just figured out the issue it's incredibly simple e-pattern does not require /^ or $/ before or after the expression, should instead read:
e-pattern="((0+(\.[0-9][05]?))|1+(\.0))"