-6

I want an Regular expression for password that contain

1.It must include at least one uppercase letter and one lowercase letter.

2.It also may include symbols but not these:=?<>()'"/\&.

Here is my regex

/^(?=.[a-z])(?=.[A-Z])[a-zA-Z,;/~`!@#$%^*-_+~[]{}|]{8,20}$/;

So please give me regular expression.

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

Try:

(?=.*[A-Z])(?=.*[a-z])(?!.*[:=?<>()'"/\&.]).*

[:=?<>()'"/\&.] Replace characters between [ and ] that you dont want to appear in password

Will match:

PassWord
Password+

Wont Match:

password
Password<>
Srb1313711
  • 2,017
  • 5
  • 24
  • 35