^ Matches the start position of the input string. If the multiline attribute of the Regexp object is set, ^ matches the position after '/N' or'/R. $ Matches the end position of the input string. If the multiline attribute of the Regexp object is set, $ also matches the location before '/N' or'/R. * Matches the previous subexpression zero or multiple times. + Match the previous subexpression once or multiple times. + Is equivalent to {1 ,}.? Match the previous subexpression zero or one time .? It is equivalent to {0, 1 }. {N} n is a non-negative integer that matches the specified n times. {N ,}n is a non-negative integer and matches at least N times. Both {n, m} m and n are non-negative integers, where n <= m. Match at least N times and at most m times. There cannot be a space between a comma and two numbers .? When this character is followed by any other delimiter (*, + ,?, The matching mode after {n}, {n ,}, {n, m}) is not greedy. The non-Greedy mode matches as few searched strings as possible, while the default greedy mode matches as many searched strings as possible.. Match any single character except "/N. To match any character including '/N', use a pattern like' [./N. (Pattern) matches pattern and obtains this match. (?: Pattern) matches pattern but does not get the matching result. That is to say, this is a non-get match and is not stored for future use. (? = Pattern) Forward pre-query: matches the search string at the beginning of any string that matches pattern. This is a non-get match, that is, the match does not need to be obtained for future use. (?! Pattern) negative pre-query, and (? = Pattern) returns X | y matches X or Y. [Xyz] Character Set combination. [^ XYZ] combination of negative character sets. [A-Z] character range, matching any character in the specified range. [^ A-Z] The negative character range matches any character that is not within the specified range. /B matches a word boundary, that is, the position between a word and a space. /B matches non-word boundaries. /CX matches the control characters specified by X. /D matches a numeric character. It is equivalent to [0-9]. /D matches a non-numeric character. It is equivalent to [^ 0-9]. /F matches a break. It is equivalent to/x0c and/Cl. /N matches a linefeed. It is equivalent to/x0a and/CJ. /R matches a carriage return. It is equivalent to/x0d and/cm. /S matches any blank characters, including spaces, tabs, and page breaks. It is equivalent to [/f/n/R/T/V]. /S matches any non-blank characters. It is equivalent to [^/f/n/R/T/V]. /T matches a tab. It is equivalent to/x09 and/CI. /V matches a vertical tab. It is equivalent to/x0b and/ck. /W matches any word characters that contain underscores. It is equivalent to '[A-Za-z0-9 _]'. /W matches any non-word characters. It is equivalent to '[^ A-Za-z0-9 _]'. /XN matches n, where N is the hexadecimal escape value. The hexadecimal escape value must be determined by the length of two numbers. /Num matches num, where num is a positive integer. References to the obtained matching. /N identifies an octal escape value or a backward reference. If at least N subexpressions are obtained before/n, n is a back reference. Otherwise, if n is an octal digit (0-7), n is an octal escape value. /Nm identifies an octal escape value or a backward reference. If there are at least is preceded by at least nm obtained subexpressions before/nm, then nm is backward reference. If at least N records are obtained before/nm, n is a backward reference followed by text M. If none of the preceding conditions are met, if n and m are Octal numbers (0-7),/nm matches the octal escape value nm. /NML if n is an octal digit (0-3) and M and l are octal digits (0-7), the octal escape value NML is matched. /UN matches n, where n is a Unicode character represented by four hexadecimal numbers.