正则验证有关问题,6-16位字母或数字

WBOY
Release: 2016-06-13 12:09:20
Original
914 people have browsed it

正则验证问题,6-16位字母或数字
正则验证问题,6-16位字母或数字
------解决思路----------------------
只能是 字母+数字 还是 字母 还是 数字 ?
------解决思路----------------------
/[0-9]/                   //数字
/[a-zA-Z]/              //字母
/[a-z0-9]/              //数字+字母
------解决思路----------------------
允许纯字母或数字串
/^[a-z0-9]{6,16}$/

必须同时含有字母和数字
/^(?=.{6,16})(?=.*[a-z])(?=.*[0-9])[0-9a-z]*$/
------解决思路----------------------
/^[a-z0-9]{6,16}$/i

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template