Character escape

xiaoxiao2021-03-06  20

Most important regular expression language operators are all non-essential single characters. Essentials / (single backslash) Notification Regular expression analyzer is not an operator behind the expression analyzer. For example, the analyzer treats an asterisk (*) as a repetition, and will be treated as a Unicode character 002a after the backslash (/ *) of the asterisk.

The characters in the following table are identified in the regular expression and replacement mode.

Essentials Description General characters except. $ ^ {[(|) * ? / Outside, other characters match itself. / a match the ring (alert) / u0007. / b If you are in the [] character class, you match the escape / u0008; if not this, please refer to the "Note" section later in this table. / t Match with the TAB RE / U0009. / r Match with the carriage return / u000d. / v matched with the vertical TAB HORT / U000B. / f matches the change page / u000c. / n matches the wrap / u000a. / e matches the ESC / U001B. / 040 Match the ASCII characters as an eight-input number (maximum three); if there is only one digit of the digital or corresponding to the capture group number, the number is a backward reference. (For more information, see Reverse references.) For example, characters / 040 represent spaces. / x20 uses hexadecimal representations (just two) match the ASCII characters. / cc matches the ASCII control character; for example, / cc is Ctrl-C. / U0020 uses hexadecimal representations (just four digits) match with Unicode characters. / When there is a character that does not identify as an escap, it matches the character. For example, / * is the same as / x2a.

Pay attention to escape characters

/ b is a special case. In the regular expression,

/ b represents a word boundary (

/ w and

/ W character); however,

[] In the character class,

/ b indicates the escape character. In the replacement mode,

/ B always indicates the retracted character.

See

Regular expression language elements

转载请注明原文地址:https://www.9cbs.com/read-42790.html

New Post(0)