Password Validation Regular Expression

조건

10~20 자리 이내 영문, 숫자, 특수문자(!, @, ) 중 2종류 이상 또는 8~20자리 이내 영문, 숫자, 특수문자(!, @, ) 중 3종류 이상을 조합

조건 정리

  1. 10~20 자리 이내 영문, 숫자, 특수문자(!, @, *) 중 2종류 이상 조합
  2. 8~20자리 이내 영문, 숫자, 특수문자(!, @, *) 중 3종류 이상 조합

상세 조건 및 정규식

    1. password must contain 1 number (0-9)
    2. password must contain 1 uppercase letters or 1 lowercase letters
    3. password must contain 1 special characters, of the group !@*
    4. password must contain 2 or more of the above
    5. password is 10-20 characters with no space
    1. password must contain 1 number (0-9)
    2. password must contain 1 uppercase letters or 1 lowercase letters
    3. password must contain 1 special characters, of the group !@*
    4. password is 10-20 characters with no space

정규식

  1. password must contain 1 number (0-9)
    • (?=.*\d)
  2. password must contain 1 uppercase letters or 1 lowercase letters
    • (?=.*[a-zA-Z])
  3. password must contain 1 special characters, of the group !@*
    • (?=.[!@])
  4. password is 10-20 or 8-20 characters with no space
    • ([^\s]){10,20} or ([^\s]){8,20}

정규식

  1. ^(?=.\d)(?=.[!@])([^\s]){10,20}$|^(?=.\d)(?=.[a-zA-Z])([^\s]){10,20}$|^(?=.[a-zA-Z])(?=.[!@])([^\s]){10,20}$
  2. ^(?=.\d)(?=.[a-zA-Z])(?=.[!@])([^\s]){8,20}$

^(?=.\d)(?=.[!@])([^\s]){10,20}$|^(?=.\d)(?=.[a-zA-Z])([^\s]){10,20}$|^(?=.[a-zA-Z])(?=.[!@])([^\s]){10,20}$|^(?=.\d)(?=.[a-zA-Z])(?=.[!@])([^\s]){8,20}$

최종

https://regex101.com/r/hqMtyd/3

(?=.\d)(?=.[!@])([\s]){10,20}$|(?=.\d)(?=.[a-zA-Z])([^\s]){10,20}|(?=.[a-zA-Z])(?=.[!@])([\s]){10,20}|(?=.\d)(?=.[a-zA-Z])(?=.[!@])([^\s]){8,20}

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×