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: