JavaScript - Asking for advice on password regularity
PHP中文网
PHP中文网 2017-06-12 09:28:59
0
4
614

/^(\w){8,50}$/ This is a regular pattern for 8 to 50 alphanumeric underscores. Now we need to add support for all special symbols (such as %@, etc.) , how to modify

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
仅有的幸福

/^(.*){8,50}$/
matches any characters, not only special characters

刘奇

Try it

/^[^\s]{8,50}$/g
仅有的幸福

/^[w%@]{8,50}/Just put the special characters you need to add into the [] character set. [] means matching any element in it.

三叔

/^(s*){8,50}$/ Try it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!