| ‘.‘ |
Dot, representing all characters except newline line break |
If the Dotall flag ID is set, it will contain the newline |
| ^ |
Represents the beginning of the string, the start of the string |
In Multline mode also matches the end of each newline in multi-line modes |
| $ |
Match the end of the string or just befor the newline at the end of the string |
In MULTILINE mode also matches before a newline. |
| ' \b ' |
does not match any string that matches the beginning or end of a word |
such as R ' \bfoo\b ' can match ' foo ', ' foo ', ' (foo) ', ' Bar foo bar ', but cannot match ' foobar ' |
| ' \b ' |
does not match any string, it is the inverse of the \b |
|
| __‘*‘__ |
Match 0 or more times repeat this symbol before the RE |
Greed |
| + |
Match 1 or more times repeat this symbol before the RE |
Greed, note is the front of a re, an ordinary character is a re not all, is the smallest unit of a re. As ab+ matches ab or abbb ... And not Ababab . |
| ‘?‘ |
Match 0 or 1 times repeat this symbol before the RE |
Greed |
| __ ' *?,??, +? ' __ |
Cut out *,?, + greed, take the minimum range they can match |
Non-greedy |
| ' {m} ' |
Repeat the re in front of this symbol for the specified quantity |
Non-greedy |
| ' {m,n} ' |
Specifies the number of M to n repeats the re in front of this symbol |
Greed, n if not specified, at least m repeats re |
| ' {m,n}? ' |
Specifies the number of M to n repeats the re in front of this symbol, but to match the minimum number |
Non-greedy |
| ‘‘ |
Escape special Characters |
That is, the literal meaning of the special character |
| ‘[]‘ |
Used to indicate a set of characters |
Special characters do not have a special meaning in [], but if the ^ symbol is the first character in [], then ^ is meaningful, not the beginning of the string, but the inverse of the complement set. and in [] except for the ^ worsening of the beginning of the symbol is having its own meaning |
| | |
Both sides are re, matching left or right, or relationship |
Non-greedy, left-to-right matching |
| ' \w ' |
|
|
| ' \w ' |
|
|
| ' \d ' |
|
|
| ' \d ' |
|
|
| ' \s ' |
|
|