01/10/2018, 16:42
Giúp chuỗi regex password trong php
Chào các bác, mình có đoạn regex sau:
^(?=.*[0-9])(?=.*[!@#$&*])w{8,32}$
quy tắc của mình là:
- có ít nhất 1 chữ số
- có ít nhất 1 ký tự đặc biệt !@#$&*
- độ dài 8 đến 32 ký tự
tổng đoạn mã là ký tự a-zA-Z0-9 và ký tự đặc biệt trên
mình đã cố gắng viết đoạn regex trên nhưng không được.
Bài liên quan
Có những regex không tồn tại
Check bằng nhiều regex
Hỏi thử chị GG với từ khoá “password regex” xem.
Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
Mình cũng đã thử link trên và ra demo này:
Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript
Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and JavaScript. The website also features a community where you can share useful expressions.
cảm ơn bác này