![](/img/trans.png)
[英]Regular expression for a password containing at least 1 upper and lowercase letters, 1 number and 1 special charater with minimum length of 8
[英]Regular expression matching strings with at least 1 uppercase, 1 lowercase, 1 number and 1 special character from a list
這是正則表達式
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\-$*.{}?"!@#%&\/\\,><':;|_~`^\]\[\)\(]).{8,}
這當前確保字符串包含至少 1 個大寫字母、1 個小寫字母、1 個數字和一個列表中的特殊字符。
我想要的是確保我不允許出現空格,但我找不到辦法做到這一點。
你可以改變.
到\\S
:
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\-$*.{}?"!@#%&\/\\,><':;|_~`^\]\[\)\(])\S{8,}$
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.