Newbie: Question about regular expression reverse reference

Source: Internet
Author: User
For new users, please refer to the following questions about reverse reference of regular expressions: Hello, everyone! I'm a Cainiao. I have something to ask. I recently read "Let's talk about PHP" and read it in a book. each subexpression in a regular expression (included in ), when no non-capturing metacharacters are added, they are stored in the buffer according to the matching results of each sub-expression from left to right and referenced by numbers 1 to 99, I don't know if this is the correct description. There are two problems: 1. The book says that if you use a number to reference a subexpression, you need to add a reversed expression before the number.
Dear elders! I'm a Cainiao. I have something to ask.

I recently read "Let's talk about PHP" and read it in a book. each subexpression in a regular expression (included in ), when no non-capturing metacharacters are added, they are stored in the buffer according to the matching results of each sub-expression from left to right and referenced by numbers \ 1 to \ 99, I don't know if this is the correct description. There are two problems:
1. The book says that using a serial number to reference a subexpression requires a backslash before the serial number to escape the subexpression. This article is very tangled and I don't need it. is it related to any version?
2. is a subexpression added with a metacharacter? :. In this way, the matching results will not be stored, so the number of the buffer will not be added, and no number can be referenced. can this subexpression be called repeatedly?

Thank you!
------ Solution --------------------
What does repeated call and reference mean? If so, do you know the answer.
------ Solution --------------------
/^ ([A-zA-Z] *) \ d + \ 1 $/
This is not Add backslash escape before the number?

Is that what you mean by the second question?
/^ (? = [A-zA-Z] +) \ d + (? = [A-zA-Z] +) $/

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.