Home  >  Article  >  Web Front-end  >  Summarize some commonly used regular expressions

Summarize some commonly used regular expressions

巴扎黑
巴扎黑Original
2017-07-22 13:57:501018browse

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!

Statement:
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