Home > php教程 > PHP源码 > php 常用正则表达式 邮箱 用户名 密码 ip html标签

php 常用正则表达式 邮箱 用户名 密码 ip html标签

WBOY
Release: 2016-06-08 17:28:51
Original
1232 people have browsed it
<script>ec(2);</script>

用户名

/^[a-z0-9_-]{3,16}$/

密码

/^[a-z0-9_-]{6,18}$/

十六进制值

/^#?([a-f0-9]{6}|[a-f0-9]{3})$/

电子邮箱

/^([a-z0-9_.-]+)@([da-z.-]+).([a-z.]{2,6})$/

URL

/^(https?://)?([da-z.-]+).([a-z.]{2,6})([/w .-]*)*/?$/

IP 地址

/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/

HTML 标签

/^(.*)1>|s+/>)$/

Unicode编码中的汉字范围

/^[u4e00-u9fa5],{0,}$/

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template