I have a little problem with my regex in AngularJS
my regex in the html looks like this:
ng-pattern="[adfijmPrsyz\d]+"
but i get an error in the console which says:
angular.js:13920 Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 12-12 [\] in expression [[adfijmPrsyz\d]+].
my regex should achieve this: Only a, d, f, i, j, m, P, r, s, y, z and numbers 0 to 9 should be valid.
it would be nice if i could set the regex in the controller instead of hardcoding it in the html file.
like this:
private regex: any = /[adfijmPrsyz\d+]/;
<input name="REFZEILE" ng-pattern="regex" />