user2573477
user2573477

Reputation: 11

Regex expression for at least one upper, lower and digit

Can anybody help me with a regex expession to check the following criteria?

The criteria is one(or more) cap letter, one (or more)lower letter and one (or more) digit. It must be more than 6 characters

What I have is

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

Am I on the right track? Keep in mind that I want it to allow symbols too

Thanks

Upvotes: 0

Views: 707

Answers (1)

Anirudha
Anirudha

Reputation: 32807

Yes you are on the right track..

Just remove .+ from your regex,it is redundant and doesn't really add anything to the regex

If you want to match more than 6 characters you should use .{7,}

Upvotes: 1

Related Questions