Regular expression _php techniques that can filter multiple lines of code in DEDECMS collection

Source: Internet
Author: User
In the past with Dede collection, always filtered more than one line of code, can only line of filtering, online, found that there are many and I like the rookie. With the continuous use of Dede acquisition, there is a further understanding of the positive, now I use a regular expression, can also match multiple lines of code.

For example: In the following code, filter out a hyperlink with two lines of code.

<TD align= "center" >
<a href= "http://www.XXX.com/111111.htm" >xxx
Xxx</a>
</td>

With the following filter, you can achieve multiple line matching
{Dede:trim} <a href= "http://www.XXX.com/111111.htm" > ([^\n<]*) </a> {/dede:trim}

Looks like \ n Such a symbol, can act as a newline character, one \ n represents a newline.
Hope to be useful to the beginner Dede.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.