Regular expressions are special characters

 

Regular expressions are special characters

\ Switch between the literal meaning and special significance. For example, \ w represent \ w of special significance (see explanation below) rather than a literal
w, but \ $ express the special significance of not using $ (see explanation below) but the characters themselves using $
^ beginning of a string of
$ characters the end of the string
* zero or more times
by one or more
? ZeroOrOne
any character except newline
\ b word boundary
\ B non-word boundary
\ d is any number from 0 to 9 (with the [0-9] same)
\ D any non-digit
\ f-feed character (form Feed)
\ n-newline

\ r carriage return
\ s any whitespace character (with [\ f \ n \ r \ t \ v] the same)
\ S any non-blank character
\ t tab
\ v vertical tab
any letter \ w, numbers, and the underscore (with [a-zA-Z0-9_] same)
\ W other characters except numbers, letters and underscore
\ ASCII character hexadecimal number nn xnn defined
ASCII character \ onn octal number nn defined
\ control characters cX X-
[ABCDE] and wherein any character matches the character set of
[^ abcde] character complement, and wherein the character set does not match any character
[AE] with a range of characters which matches the character set
[\ B] back literal sense (different from \ B) grid characters
{n} the preceding character appears exactly n times
{n,} foregoing character appears at least n times
{n, m} characters appear in front of times n ~ m
() a group, can refer to it later
x | yx y or

 

Published an original article · won praise 3 · views 10000 +

Guess you like

Origin blog.csdn.net/u011927449/article/details/104062763