Ask for a regular expression (?> What does pattern mean?

Source: Internet
Author: User
Ask for a regular expression (? & Gt; pattern) what does it mean? today, I found such a regular expression in the source code of smarty, which cannot be understood. please kindly advise.
(?> [^ "\ '= \ S] +)


Reply to discussion (solution)

?> Match from specified characters

Where can I see it?
If yes?> Start, should I add \ to the question mark?


I have never learned English. I guess

Oh, from?> The subsequent characters cannot be found in related articles...
(?> The difference between [^ "\ '= \ s] +) and ([^" \' = \ s] +) is none.

Where can I see it?
If yes?> Start, should I add \ to the question mark?



The question mark and the greater sign are not part of the regular expression. they are similar to the line expression of the windows command line.
For example:
C: \> dir

Its? Equivalent to C :\
> Yes
Its [^ "\ '= \ s] + is equivalent to dir

The above is my understanding

Where can I see it?
If yes?> Start, should I add \ to the question mark?



The Smarty_Compiler.class file contains a lot of such usage.


Where can I see it?
If yes?> Start, should I add \ to the question mark?



The question mark and the greater sign are not part of the regular expression. they are similar to the line expression of the windows command line.
For example:
C: \> dir

Its? Equivalent to C :\
> Yes
Its [^ "\ '= \ s] + is equivalent to dir

The above is my understanding


According to what I learned in the source code, it should not mean this.

I have solved this problem, (?> The pattern expression is called a curing group. it is mainly used to improve the efficiency of regular expressions and optimize regular expressions. it is a little different from normal regular expressions. to learn more, Baidu searches regular expressions to solidify the group.

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.