Regular expression formula and tutorial

Time:2020-10-21
Reprinted at:
https://blog.csdn.net/weng_xianhu/article/details/10096863

In fact, regular is snobbish, cutting the head to get money
If you can’t recognize a special symbol, use an inverted bar to guide the way
The reverse bar is followed by a small w, which is represented by a numeric letter; (- W followed by a numeric letter; – D followed by a number)
The backward bar is followed by a small D, which is only represented by a number;
The back bar is followed by a small a, and the alarm symbol beeps;
The backward bar is followed by small B, word boundary or backspace;
The inverted bar is followed by a small T, and the tab symbol is very clear;
The reverse bar is followed by a small R, and the carriage return symbol is known;
The backward bar is followed by a small s, and the space symbol is very important;
There are so many small letters and large letters;
The reverse bar is followed by a large W, and alphanumeric stands aside;
The big s follows the backward bar, and the blank stands on the side;
The reverse bar is followed by a big d, and the number stands aside;
The inverted box is followed by a big B, excluding the beginning and end;

To repeat a single character, use three symbols to help
0 star plus 1 to infinity, the question mark only includes 0 and 1; (* table 0-n; + table 1-N;? Table 0-1 repeats)
There are many knowledge in the curly brackets, and the ability of repeated operation is strong; ({n} {n,} {n, m})
If you want to repeat a string, surround it with a circle; ((ABC) {3} means the string “ABC” repeats three times)
Special set customization, bracket to help you;
The escape symbols do not work, one by one;
There are too many lines. Please give me a hand with the horizontal bars
If the sharp point is placed in brackets, the antonym definition is powerful; ([^ A] refers to any character except “a”)
1. Vertical effect is not small, both sides are regular and replace each other; (the keyboard and “\” are the same key)
1. Vertical can be used many times, complex definition is very convenient;
Round brackets are used for many purposes;
Refers to the specified group in reverse direction, and the number arrangement corresponds to it; ((the number “1” in “﹤ B (﹤ B ﹤ S + ﹥ 1 / b” refers to the “(\ W +)” before it.)
Support group name customization, question mark plus angle brackets; (? < word > \ W + “is defined as a group in” (? < word > \ W +) “, and the group name is” word “)
The round bracket is used for many purposes, and the position is specified by it;
Question mark, equal sign string, position in front of the string; (“- B / W + (? = ing / b)” locates the string before “ing”)
To locate the string after it, insert a less than sign in the middle; (“(? < = \ bsub) / W + \ B” locates the string after “sub”)
A question mark with an exclamation mark followed by a string string;
PHPer knows! It means to take the opposite;
If you don’t follow this string, all of them are in accordance with the registration; (“\ w * D (?! OG) w *”, “dog” does not match, “do” conforms)
The question mark is less than the exclamation mark, followed by a string string;
If you don’t put this string in front of you, you should report to us;
The dot and asterisk are greedy, and adding a question mark is not greedy;
The plus sign question mark has a guaranteed bottom, which should be repeated at least once;
Two question mark old rules, 0 times a group turn;
Curly braces followed by a? Greedy becomes not greedy;
There are still a lot of them that can’t be installed. They will be added later

Recommended Today

Regular expression sharing for checking primes

This regular expression is shown as follows: Regular expressions for checking prime numbers or not To use this positive regular expression, you need to convert the natural number into multiple 1 strings. For example, 2 should be written as “11”, 3 should be written as “111”, 17 should be written as “11111111111”. This kind of […]