PHP正则表达式函数有哪些
Jun 02, 2016 am 11:30 AMPHP正则表达式函数有:1、“preg_filter”函数;2、“preg_grep”函数;3、“preg_last_error”函数;4、“preg_match”函数;5、“preg_quote”函数等等。
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中文网!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to match multiple words or strings using Golang regular expression?

How to replace a string starting with something with php regular expression

How to use regular expressions to remove Chinese characters in php

How to use regular matching to remove html tags in php

Sharing tips on using PHP regular expressions to implement Chinese replacement function

PHP uses regular expressions to verify whether the input data is a number

How to verify if a URL is HTTPS protocol using PHP regex

How to use regular replacement to fix Chinese in PHP
