整理几个常用的正则
最近重新对DoraCMS中的正则表达式进行了整理,前后端同步校验,下面列出几个常用的
最近重新对DoraCMS中的正则表达式进行了整理,前后端同步校验,下面列出几个常用的:
1、用户名校验:
5-12个非特殊字符
^[a-zA-Z][a-zA-Z0-9_]{4,11}$
2、邮箱校验
^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$
3、密码校验
5个字符以上,数字、字母下划线等
(?!^\\d+$)(?!^[a-zA-Z]+$)(?!^[_#@]+$).{5,}
4、QQ号码校验
^[1-9][0-9]{4,9}$
5、手机号校验
^1[3|4|5|8][0-9]\d{4,8}$
6、中文字符校验
[\u4e00-\u9fa5]
很赞哦! ( 0
)
相关文章
- HTML5 input Placeholder(占位符)样式
- Node.js API实例讲解——http.IncomingMessage
- FIS3 , 为你定制的前端工程构建工具
- Node.js API实例讲解——Buffer的写入方法
- Node.js API实例讲解——Socket 对象
- Node.js API实例讲解——创建http服务器
- Node.js API实例讲解——Buffer的静态方法
- Node.js API实例讲解——https服务器与客户端
- Node.js API实例讲解——FS文件系统概述
- Node.js API实例讲解——进程的操作
- Node.js API实例讲解——二进制类型转换
- Node.js API实例讲解——创建UDP服务器