Regular Expression-how to ignore escape matching in php Regular Expressions

Source: Internet
Author: User
Recently I am writing a markdown Syntax Parsing program. I have encountered the following problems. For example, I want to increase the font syntax by * ABC *, that is, it contains two characters on the outer side of the character *. I can use regular expressions to write expressions easily. However, if I want to increase the number of characters that contain the * character, I want to use... recently I am writing a markdown Syntax Parsing program. I have encountered the following problems. For example, I want to increase the font Syntax: * ABC *That is to say, there are two *. I can use regular expressions to write expressions easily.

However, if I want to add more words*This character, I want to use\Escape this match with a backslash, just like this* AB \ * C *. I only need to match the characters that are not marked as escaped by the backslash on the outermost side. How can I use regular expressions?

Reply content:

Recently I am writing a markdown Syntax Parsing program. I have encountered the following problems. For example, I want to increase the font Syntax:* ABC *That is to say, there are two*. I can use regular expressions to write expressions easily.

However, if I want to add more words*This character, I want to use\Escape this match with a backslash, just like this* AB \ * C *. I only need to match the characters that are not marked as escaped by the backslash on the outermost side. How can I use regular expressions?

 * AB \ * C * [1] => AB \ * C)

I don't know if this is the meaning. The matching must start with * rather \ *.

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.