Home > Article > Backend Development > Specified characters of variables in php regular replacement_PHP tutorial
The following are three implementations to introduce the specified characters of variables in PHP regular substitution. Computer friends who need to learn can refer to them.
Three methods.
1.
The code is as follows | Copy code | ||||||||||||||||||||||||||||||||||||||||||||||||
?>
All three methods return the same result. The Perl style regular expression in PHP is exactly the same as Perl. Even the quotemeta is universal..
Some other examples of regular expressions Example:
//Match a position that is not followed by bar foobar123***abcbar
http: //www.bkjia.com/PHPjc/633093.html TechArticleThe following are three implementations to introduce the designated characters of variables in PHP regular substitution. For those who need to learn, Can be used for reference. Three methods. 1. The code is as follows Copy the code ?php $str = preg_qu...
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 Previous article:A simple sorting of multidimensional arrays in PHP_PHP tutorialNext article:A simple sorting of multidimensional arrays in PHP_PHP tutorial Related articlesSee more |