C # tutorial on regular expression usage

Source: Internet
Author: User

C # tutorial on regular expression usage

1. metacharacters

In the above example, we came into contact with a metacharacters \ d. As you may think, regular expressions also have many metacharacters like \ d. The following table lists some common metacharacters:

2. escape characters

If you want to find the metacharacters themselves, for example, if you want to search for. Or *, you may encounter a problem: You cannot specify them because they will be interpreted as other meanings. In this case, you must use \ to cancel the special meanings of these characters. Therefore, you should use \. And \*. Of course, to find the \ itself, you also need to use \\.

3. Qualifier

A qualifier is also called a repeated description character, indicating the number of times a character will appear. For example, if we use {3, 4} to match the phone number, it indicates that the phone number appears 3 to 4 times. Common delimiters are:

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.