Regular Expression-php Regular Expression matching p tags and specific Chinese Characters

Source: Internet
Author: User
{Code...} I want to use a php regular expression to match the p tag with text content. 1. p labels may contain carriage return and spaces. 2. For Chinese characters, "1" may change, and "what" may change.

Chapter 1 What

I want to use php regular expressions to match the p tag with text content.

Describe the situation,
1. p labels may contain carriage return and spaces;
2. In terms of Chinese characters, "1" will change, and "what" will change.

Reply content:

Chapter 1 What

I want to use php regular expressions to match the p tag with text content.

Describe the situation,
1. p labels may contain carriage return and spaces;
2. In terms of Chinese characters, "1" will change, and "what" will change.

Let me say that. There is no need for complicated reasons. A few simple use cases will kill you:

This is your text.

This is a valid paragraph too, since HTML

Paragraph don't have to contain an explicit ending tag. <p id = "sample"> This is another paragraph.

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.