Home > php教程 > php手册 > body text

php中实现17种正则表达式,php17种正则表达式

WBOY
Release: 2016-06-13 09:21:38
Original
1180 people have browsed it

php中实现17种正则表达式,php17种正则表达式

php中实现17种正则表达式

该教程来自:php教程网:http://php.662p.com

"^\d+[        DISCUZ_CODE_1        ]quot;  //非负整数(正整数 + 0)
"^[0-9]*[1-9][0-9]*[        DISCUZ_CODE_1        ]quot;  //正整数
"^((-\d+)|(0+))[        DISCUZ_CODE_1        ]quot;  //非正整数(负整数 + 0)
"^-[0-9]*[1-9][0-9]*[        DISCUZ_CODE_1        ]quot;  //负整数
"^-?\d+[        DISCUZ_CODE_1        ]quot;    //整数
"^\d+(\.\d+)?[        DISCUZ_CODE_1        ]quot;  //非负浮点数(正浮点数 + 0)
"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))[        DISCUZ_CODE_1        ]quot;  //正浮点数
"^((-\d+(\.\d+)?)|(0+(\.0+)?))[        DISCUZ_CODE_1        ]quot;  //非正浮点数(负浮点数 + 0)
"^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))[        DISCUZ_CODE_1        ]quot;  //负浮点数
"^(-?\d+)(\.\d+)?[        DISCUZ_CODE_1        ]quot;  //浮点数
"^[A-Za-z]+[        DISCUZ_CODE_1        ]quot;  //由26个英文字母组成的字符串
"^[A-Z]+[        DISCUZ_CODE_1        ]quot;  //由26个英文字母的大写组成的字符串
"^[a-z]+[        DISCUZ_CODE_1        ]quot;  //由26个英文字母的小写组成的字符串
"^[A-Za-z0-9]+[        DISCUZ_CODE_1        ]quot;  //由数字和26个英文字母组成的字符串
"^\w+[        DISCUZ_CODE_1        ]quot;  //由数字、26个英文字母或者下划线组成的字符串
"^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+[        DISCUZ_CODE_1        ]quot;    //email地址
"^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?[        DISCUZ_CODE_1        ]quot;    //url
Copy after login

  详细说明:http://php.662p.com/thread-532-1-1.html

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!