1

I'm trying to have a Reg Exp for the following:

8 characters min
1 uppercase (at least)
1 lowercase (at least)
1 digit (at least)
Excluding: + @ &

I have the following but I can't seem to have the right combo of group/sub-group to make them work together:

[^+@&](?=.*\d)(?=.*[a-z])(?=.*[A-Z])).{8,}

I need guidance!

1 Answer 1

1

You need to use anchors and place the negated class after your assertions.

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^+@&]{8,}$
Sign up to request clarification or add additional context in comments.

Comments

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.