Today, we will record some basic knowledge about regulator for future use.
1. Some syntaxes to be remembered.
Character matching Syntax:
\ D matches the number '\ d' to 3, not C;
\ D match non-digit '\ d' match C, not match 3;
\ W matches any single character '\ W \ W' to match A3, not @ 3;
\ W match non-single character '\ W' match @, does not match C;
\ S matches blank characters '\ D \ s \ d' to match 3 D, not ABC;
\ S matches non-null characters '\ s \ s' to match a #4, not 3 D;
. Match any character '...' matches a $5, does not match line feed;
[…] Matching any character in the brackets [B-d] matches B, C, and D, but does not match E;
[^…] Match non-Parentheses [^ B-Z]: Match A. do not match B-Z;
Repeated matching Syntax:
{N} matched n characters \ D {3} matched \ D, not matched \ D or \ D
{N ,}match n times or more \ W {2} match \ W and \ W or above, not match \ W
{N, m} matches \ s, mismatch \ s
? Match 0 or 1 time 5? Match 5 or 0, not 5 or 0
+ Match one or more \ s + matches more than one \ s, and does not match more than one \ s
* Match 0 or more times \ W * match 0 or more \ W, not match non-N * \ W
Character locating Syntax:
^ Locate the start position of the subsequent mode
$ The front mode is at the end of the string
\ A Start position of the previous Mode
\ Z front mode end position
\ Z front mode end position (before line feed)
\ B matches a word boundary
\ B matches a non-word boundary
Escape matching Syntax:
"\" + Actual character \. * +? | () {}^ $ For example: \ matched character "\"
\ N match line feed
\ R match and press ENTER
\ T matches horizontal tabs
\ V matches vertical tabs
\ F match form feed
\ NNN matches an octal ASCII
\ Xnn matches a hexadecimal ASCII
\ Unnnn matches four hexadecimal uniode
\ C + uppercase letters match Ctrl-UPPERCASE letters, for example, \ CS-match Ctrl + S
The above are some regulator syntaxes that must be memorized.