“pola regex untuk validasi kata sandi” Kode Jawaban

Validasi regexp untuk kata sandi yang dijelaskan

r'^
  (?=.*[A-Z])       // should contain at least one upper case
  (?=.*[a-z])       // should contain at least one lower case
  (?=.*?[0-9])      // should contain at least one digit
  (?=.*?[!@#\$&*~]) // should contain at least one Special character
  .{8,}             // Must be at least 8 characters in length  
$
Difficult Dugong

Ekspresi Regex untuk Validasi Validasi Kata Sandi Validasi

/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/
Ugliest Unicorn

pola regex untuk validasi kata sandi

// Match at least one uppercase letter, 
// at least one lowercase letter, 
// at least one digit 
// and includes 12 or more symbols
String validPassRegex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\\S+$).{12,}$";

// and special characters:
String validPassRegex2 = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\S+$).{8,}$";

Jawaban yang mirip dengan “pola regex untuk validasi kata sandi”

Pertanyaan yang mirip dengan “pola regex untuk validasi kata sandi”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya