Home  >  Article  >  Backend Development  >  How to implement PHP regular matching that does not contain a certain character

How to implement PHP regular matching that does not contain a certain character

藏色散人
藏色散人Original
2020-08-07 10:23:543347browse

How to implement php regular matching that does not contain a certain character: first create a PHP sample file; then enter the statement "$search = '/86c0a704063348751055e842f0ab8514/is ';preg_match_all($search,$str,$r);"; Finally, execute the file.

How to implement PHP regular matching that does not contain a certain character

Recommended: "PHP Video Tutorial"

php Regular matching content does not include A certain character

Specific question:

I need to match characters that include 6d267e5fab17ea8bc578f9e7e5e1570b, but they cannot contain 04e913388da01775a4f8f7a1930af93a> and dec3ace20c729a46134a59cb893ab081

I want to match d7eea8d76a7c5d1c127f2cb188d613c3 and dec3ace20c729a46134a59cb893ab081

Implementation method:

<?php
$str = &#39;客户您好,为您推荐以下项目:<项目2:项目名称<项目3:项目名称>>以及<项目1:项目名称>&#39;;
$search = &#39;/<([^<]*?)>/is&#39;;
preg_match_all($search,$str,$r);
echo &#39;<pre class="brush:php;toolbar:false">&#39;;
print_r($r);
echo &#39;
'; ?>

The above is the detailed content of How to implement PHP regular matching that does not contain a certain character. 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