Regular expression question mark colon?: Using __ Regular expressions

Source: Internet
Author: User

(?: pattern) matches patterns without capturing the bracket, but does not capture the matching result.    (pattern) is a capturing bracket. Match pattern, match pattern and capture results, automatically get group number (?<name> pattern) match pattern, match pattern and capture results, set name to use parentheses for group names to specify a subexpression, the text that matches the subexpression (that is, what this group captures) can be further processed in an expression or other program.      By default, each capturing group automatically owns a group number, which is left to right, is marked with the left parenthesis of the group, the first group that appears is 1, the second is 2, and so on.         If both the normal and named capture groups exist in the regular expression, the number of the capturing group should be paid special attention to, the number rule is to number the normal capturing group first, then the named Capture Group. To avoid too many parentheses to clutter up numbers, and to avoid unwanted capture efficiencies, you can use a non-capture bracket when you don't need to capture just the group you want to specify. The non-capture bracket in question is used for this purpose.

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.