Home > Backend Development > PHP Tutorial > Regular expressions that can filter multiple lines of code in dedecms collection dedecms collection

Regular expressions that can filter multiple lines of code in dedecms collection dedecms collection

WBOY
Release: 2016-07-29 08:36:42
Original
904 people have browsed it

In the past, when I used dede to collect code, I couldn't filter out more than one line of code, and could only filter it line by line. On the Internet, I found that there are many novices like me. With the continuous use of dede collection, I have a better understanding of regular expressions. Now I can even use a regular expression to match multiple lines of code.
For example: In the following code, filter out hyperlinks with two lines of code.

XXX
XXX


Use the following Filtering can achieve multi-line matching
{dede:trim} ([^n<]*) {/dede:trim}
It looks like a symbol like n can be used as a newline character. An n represents a newline.
Hope it will be useful to those who are new to dede

The above introduces the regular expressions in dedecms collection that can filter multiple lines of code in dedecms collection, including the content of dedecms collection. I hope it will be helpful to friends who are interested in PHP tutorials.

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