php 正则负向的理解

WBOY
Release: 2016-06-23 13:28:32
Original
1031 people have browsed it

     $str='' ;
     $patten='//'  ;     
     $str=preg_replace($patten,"",$str);
     echo $str;
     echo "\n" ;
     $patten='//'  ;       
     //php正则正向与负向的理解   
     //这里话应该理解为之间有至少8个字符 并且不以ab开头
     //错误的理解 之间最前两个字符不能为ab且后面还要跟至少8个字符
     $str=preg_replace($patten,"",$str);
     echo $str;  
     echo "\n" ;
?>

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