When PHP is matched, can a long string be treated as an atom, for example, the following

Source: Internet
Author: User
(
 
  
  

.*?<\/p><\/blockquote>)?


I want to match this piece of content, but this content

.*?<\/p><\/blockquote> is dispensable.
But what's in the back? It's about atoms, it means 0 or 1 atoms, and the front is not an atom but a string.
How to achieve it?


Reply to discussion (solution)

Add a choice

(

. *?<\/p><\/blockquote>|. *)?

Add a choice

(

. *?<\/p><\/blockquote>|. *)? The test, the error.

don't know what you're going to do?

don't know what you're going to do?
I want to match this content

 
     
     

Middle is content


But this paragraph There may be content, there may not be. That's it.

What does that mean?

preg_match_all ('/(BB)? ( c+)/', ' ABBCCC ', $r);p rint_r ($r);p Reg_match_all ('/(BB)? ( 
 c+)/', ' ABDCCC ', $r);p Rint_r ($r); 

What does that mean?

preg_match_all ('/(BB)? ( c+)/', ' ABBCCC ', $r);p rint_r ($r);p Reg_match_all ('/(BB)? ( c+)/', ' ABDCCC ', $r);p Rint_r ($r); 
No. If you can't speak clearly, you can solve it by other means first. Thank you.
  • Related Article

    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.