Home  >  Article  >  php教程  >  dedecms采集中可以过滤多行代码的正则表达式

dedecms采集中可以过滤多行代码的正则表达式

WBOY
WBOYOriginal
2016-06-13 12:32:211131browse

过去用dede采集,总是过滤不掉一行以上的代码,只能一行行的过滤,在网上,发现有很多和我一样的菜鸟。随着不断的使用dede采集,对正则有了更进一步的了解,现在偶用一句正则表达式,同样可以匹配多行代码了。

如:在如下代码中,过滤掉有二行代码的超级链接。


XXX
XXX



用下面的过滤,即可实现多行匹配
{dede:trim} ([^\n {/dede:trim}

貌似 \n 这样的符号,可以充当换行符使用,一个 \n 代表一个换行。
希望对初学dede的人有用 
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