2

When attempting to use the following regex pattern with ng-pattern:

[(?=^.{8,100}$)((?=.*[a-zA-Z])(?=.*\d)|(?=.*[a-zA-Z])(?=.*\W)|(?=.*\W)(?=.*\d)).*$]

angular js throws a lexer error: Lexer Error: Unexpected next character at columns 34-34 [] in expression

How do you escape the offending character which I believe is the backslash ().

1 Answer 1

5

Solved it. I was simply leaving the "/" out of the pattern in the attribute. First question is a bad question.

Sign up to request clarification or add additional context in comments.

2 Comments

You helped me figure out why i was getting an error! So you've done well ;) Now to figure out why my ng-repeat is negated. Regardless, thanks.
Had the same problem, was driving me crazy. Not such a bad question 'cause searching turned up this and solved my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.