. Represents any single character and does not match the linefeed.
* Is A quantizer, indicating that the previous content appears 0 to multiple times.
+ It is also a quantizer, indicating that the previous content appears one to multiple times.
Character Set abbreviation
\ D indicates a number
\ W represents a word character () number, letter, underline)
\ S indicates a blank space. It can match line breaks, tabs, page breaks, carriage returns, and spaces.
\ D indicates that a non-number is equivalent to [^ \ D]
\ W indicates that a non-word character is equivalent to [^ \ W]
\ S indicates that a non-blank character is equivalent to [^ \ s]
Modifier of Perl Regular Expression
/I indicates case-insensitive, such as/Yes/I matching
/S can be used to modify. (any non-wrap single character), so that. line breaks can be matched, for example,/. b/S can match a \ Nb, which is modified by/s. equivalent to [\ D]
/X causes the blank spaces (spaces or tabs) in the mode to be ignored during mode matching, for example /-? \ D */X matches 0 or 1 minus sign followed by 0 to multiple numbers
Character Anchorage
^ Indicates the starting position of the modifier./^ Fred/matches only strings starting with Fred.
$ Specifies the delimiter of a character./Fred $/matches only strings ending with Fred.