0

Im using laravel and I want to allow password that must have atleast 1 from each of the following categories:

  1. a-z or A-Z (alphabets)
  2. 0-9 (digits)
  3. Special symbol (!@#$ ......) (All symbols just like google)

Can someone give a regex expression for this as I dont know how regex works.

I have tried this:

^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[`~!@#$%^&*()-_=+[]{}|;:",<.>\/?]).*$

But i dont understand what (?=.{3,}) does and also its not working as I would expect

I will test the expression on https://regex101.com/. So I hope you test it there first before posting the answer.

Raj
  • 1,776
  • 2
  • 20
  • 46

0 Answers0