First put a URL: https://regexper.com/
This tool is used to help understand regular expressions and is useful when you are reading regular expressions.
Metacharacters
Non-alphabetic characters that have special meanings. Includes: * +? ^ $ . | \ () [] {} , if you can say the meaning of these symbols at once, it means that the basis of the regular expression is mastered.
[]: Used to match a class of Word character;
[^]:[^ indicates that this type of character is not included. The ^ in brackets indicates the meaning of inversion;
[-]: Inside the brackets - meaning of the range.
. : matches all characters.
\d: Match all the numbers;
\d: Matches all non-numbers;
\s: Matches all whitespace characters (space carriage return line)
\s: Matches all non-whitespace characters;
\w: Match alphanumeric underline;
\w: Matches a character other than a non-alphanumeric underscore.
\b: Match word boundaries;
\b: Matches the non-word boundary;
^: match the beginning;
$: Match end;
?: The preceding character is modified to indicate a maximum of 1 occurrences;
+: Modifies the preceding character to indicate a minimum occurrence of 1 occurrences;
*: Modify the preceding character, indicating that it can appear any time;
{n}: Modifies the preceding character, indicating that n times occurs;
{N,}: Indicates at least n occurrences;
{n,m}: Indicates the occurrence of N to M times; The default is greedy mode, as many matches as possible;
{n,m?} : Non-greedy mode, once the match succeeds can no longer match backwards:
(): Grouping to enable quantifiers to act on a set ofcharacters; \ n: Represents the contents of the captured packet (reverse reference);
An expression or meaning; Example:red| Blue matches Red or blue; Example:bl (ue|ack) matches Blue or black;
(? =\d): Assert, modify the preceding character, indicating not only to match the preceding regular content, but also to match the content of the assertion, the assertion part is only verified, not calculated;
The knowledge carding of regular expressions