A wonderful map

Ps: Follow the public account [MarkerHub] and reply to [Mind Map] to obtain the source map file.

Map content analysis

  • Grammatical structure
  • character
    • Common characters: letters, digits, Chinese characters, and underscores (_) match one of the same characters
    • Simple escape characters: \n (newline),\t (tabulator),\ (itself) and ^… (^ Special symbols should be escaped if they match themselves)
    • Standard character set

      Be case sensitive, uppercase means opposite, match means opposite, don’t match
      • \d Any number, 0 to 9
      • \w Any letter, digit, Chinese character or underscore, A~Z, A~Z, 0~9, _ and any Chinese character
      • \s Any whitespace, including Spaces, tabs, and line feeds
      • . The decimal point can match any character except a newline. (To match all characters including “\n”, you usually use [\s\ s].)
    • Custom character collection

      [] Square brackets matching mode, which can match any character in square brackets. ^ indicates invert
      • Matches “A” or “b” or “5” or “@”
      • [^ ABC] Matches any character except a, b, and c
      • [f-k] Matches the characters between “f” and “k”
      • [^ a-f0-3] Matches any character except “A”-“F”,”0″-“3”
  • Quantifier (Quantifier)

    If you want to modify multiple expressions, enclose the expression with ()
    • The {n} expression repeats n times
    • {m,n}

      The expression is repeated at least m times and at most N times
      • Greedy mode (the default) matches the longest string that matches
      • Non-greedy mode (add? Example: {m, n}? Matches the shortest string that matches
    • The {m,} expression repeats at least m times
    • ? Match expression 0 or 1 times, equivalent to {0,1}

      The expression occurs at least once, equivalent to {1,}

      The expression does not occur or occurs any time, equivalent to {0,}

  • Characters of the boundary

    Zero width: Matches not characters but positions, positions that meet certain conditions
    • ^ Matches the beginning of the string
    • $matches where the string ends
    • \b matches the boundary of a word. The characters before and after the current position are not all \ w
  • Pre-search (zero-width assertion, circumferential)

    Zero width: Matches not characters but positions, positions that meet certain conditions
    • (? =exp) asserts that the position after which it appears matches the expression exp
    • (? ! Exp) does not match the expression exp after the position where the assertion itself appears
    • (? <=exp) asserts that the position before which it appears matches the expression exp
    • (?
  • Match the pattern

    Processing of text
    • IGNORECASE Ignores case patterns
      • Ignore case when matching
      • The default is case sensitive
    • SINGLELINE Single-line mode
      • The entire text is treated as a string, with only one beginning and one end
      • Enables the decimal point “.” to match any character including newline (\n)
    • MULTILINE mode
      • Each line is a string
      • In multi-line mode, if you want to match only the beginning and end of A string, use \ A and \ Z
  • Selectors and groups

    Branch structure, capture combination, not capture group
    • | branch structure about the expression, “or” relationship between matching left or right
    • () Capture group
      • (1) When modifying the number of matches, the expression in parentheses can be modified as a whole
      • (2) When taking the matching result, the content matched by the expression in parentheses can be obtained separately
      • (3) Each pair of parentheses is assigned a number, and the capture using () is automatically numbered starting from 1 in the order of the left parentheses. The first capture numbered zero is the text matching the entire regular expression pattern
      • Backreferencing: By backreferencing, you can reference a string that has been captured by a group.
    • (? :Expression) Non-capture group Some expressions have to use () but do not need to save the content of the neutron Expression match of (). In this case, we can use non-capture group to offset the side effects of ().

Recommended reading

The 100 best Java Open Source projects to learn on Github, covering a variety of technology stacks!

2, open source blog project Eblog complete construction tutorial!