PHP正则表达式函数有哪些

PHPz
Release: 2020-09-04 14:59:41
Original
2362 people have browsed it

PHP正则表达式函数有:1、“preg_filter”函数;2、“preg_grep”函数;3、“preg_last_error”函数;4、“preg_match”函数;5、“preg_quote”函数等等。

PHP正则表达式函数有哪些

PHP正则表达式函数有哪些?

PHP 正则表达式(PCRE)

正则表达式(regular expression)描述了一种字符串匹配的模式,可以用来检查一个串是否含有某种子串、将匹配的子串做替换或者从某个串中取出符合某个条件的子串等。

更多正则表达式的内容可参考我们的:正则表达式 - 教程。

PHP 中我们可以使用 PCRE 扩展来匹配字符串的模式。

PCRE 函数

函数 

preg_filter 执行一个正则表达式搜索和替换

preg_grep 返回匹配模式的数组条目

preg_last_error 返回最后一个PCRE正则执行产生的错误代码

preg_match_all 执行一个全局正则表达式匹配

preg_match 执行一个正则表达式匹配

preg_quote 转义正则表达式字符

preg_replace_callback_array 执行一个正则表达式搜索并且使用一个回调进行替换

preg_replace_callback 执行一个正则表达式搜索并且使用一个回调进行替换

preg_replace 执行一个正则表达式的搜索和替换

preg_split 通过一个正则表达式分隔字符串

更多相关知识,请访问PHP中文网

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