PHP中嵌入正则表达式常用的函数有四个: 1.preg_match() :preg_match() 函数用于进行正则表达式匹配,成功返回 1 ,否则返回 0 . 语法:int preg_match( string pattern, string subject [, array matches ] ) 参数说明: 参数 说明 pattern 正则表达式 subject 需要匹配检索的对象 matches 可选,存储匹配结果的数组, $matches[0] 将包含与整个模式匹配的文本,$match