Home  >  Article  >  Backend Development  >  一段PHP正则的不解,该如何解决

一段PHP正则的不解,该如何解决

WBOY
WBOYOriginal
2016-06-13 13:33:36825browse

一段PHP正则的不解

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
$zz2="/\/is";
$text=preg_replace($zz2,"",$text);


阅读这段"去掉图片链接"的PHP代码,
下面是对代码的一些不解:
1. 开头处 \2.后面已经有is指明不区分大小写了,前面还有必要用组合来区分(a|A)大小写吗?

------解决方案--------------------
这段正则写的太过冗长,你的理解是正确的
------解决方案--------------------
1: 加与不加都可以。
2:没有必要了。写一个即可。
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