Home > Web Front-end > JS Tutorial > body text

Summarize some commonly used regular expressions

巴扎黑
Release: 2017-07-22 13:57:50
Original
1017 people have browsed it

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

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

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

/^[a-z\d]+(\ .[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/

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

IP address/((2[0-4]\d|25[0-5]| [01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)/

/^(?:(?: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 Tags/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/> ;)$/

Delete code\\comments(?

The range of Chinese characters in Unicode encoding/^[\u2E80-\u9FFF]+$/

The above is the detailed content of Summarize some commonly used regular expressions. For more information, please follow other related articles on the PHP Chinese website!

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