Character |
Description |
Simple Example |
\ |
Escape special characters |
/A \ */Applicable to comparison with "A *", where * is a special character. To avoid its special meaning, you must add "\" |
^ |
The starting position of the primary Column |
/^ A/comparable to "a" in "ABCD", but not comparable to "AAB" |
$ |
Compare the end position of the limit Column |
/A $/comparable to "a" in "BCDA", but not comparable to "AAB" |
* |
Zero or more times than the previous character |
/Bo */comparable to "booo" in "good boook" or "B" in "good BK" |
+ |
Equivalent to {1 ,} |
/A +/comparable to "AAA" in "caaandy", but not comparable to "cndy" |
? |
Zero or one time than the previous character |
/E? L/comparable to "EL" in "Angel", it can also be compared to "L" in "angle" |
. |
Compared to any character (but the Delimiter is not counted) |
/. N/comparable to "an" and "on" in "Nay, an apple is on the tree", but not comparable to "nay" |
(X) |
Compare to X and store the matching part into a variable |
/(A *) and (B *)/comparable to "AAA" and "BB" in "AAA and BB ", set the two pairs to Regexp. $1 and Regexp. $2. |
XY |
Comparison with X or Y |
/A * B */g can compare "AAA" and "BB" in "AAA and BB" |
{N} |
Compared to the previous CHARACTER n times, n is a positive integer |
/A {3}/comparable to "AAA" in "lllaaalaa", but not "AA" |
{N ,} |
Compared to the previous character for at least N times, n is a positive number |
/A {3,}/comparable to "AAA" and "AAAA" in "aa aaa aaaa", but not "AA" |
{N, m} |
The ratio is positive for at least N times and at most m times for the previous character. |
/A {3, 4}/comparable to "AAA" and "aaaa" in "aa aaa aaaaa", but not comparable to "AA" and "AAAAA" |
[Xyz] |
Compared to any character in the ARC |
/[ECM]/comparable to "E", "C", or "M" in "welcome" |
[^ XYZ] |
Compared to any character that does not exist in the ARC |
/[^ ECM]/the opposite of [xyz] for "W", "L", and "O" in "welcome. (Note the difference between the functions of/^/and [^] at the same time .) |
[\ B] |
Backspace character) |
The difference between [\ B] and \ B can be better than that of a backspace. |
\ B |
Comparison with English text, such as spaces |
For example,/\ bn \ W/can be compared to 'no' in "noonday '; /\ WY \ B/comparable to 'ly 'in "possibly yesterday' |
\ B |
Comparison with non-English text 」 |
For example,/\ W \ BN/can be compared to 'on' in "noonday ', In addition,/Y \ B \ W/can be compared to 'day' in "possibly yesterday' |
\ CX |
Control Character, where X is a control character |
/\ Cm/can be compared to control-m in a string |
\ D |
Equivalent to [0-9] |
/[\ D]/comparable to any number of words from "0" to "9", but their names, such as letters, are not comparable |
\ D |
Equivalent to [^ 0-9] |
/[\ D]/comparable to "W" ""... However, it is not comparable to a number such as "7" and "1 ". |
\ F |
Comparison with form-feed |
If there is a line in the text that produces "success", the comparison can be successful. |
\ N |
Comparison with the delimiter |
If there is a line with "success" in the text, the comparison can be successful. |
\ R |
Returns |
|
\ S |
Equivalent to [\ f \ n \ r \ t \ v] |
/\ S \ W */comparable to "B" in "a B" |
\ S |
For any non-blank character, it is equivalent to [^ \ f \ n \ r \ t \ v] |
/\ S/\ W * is comparable to "a" in "a B" |
\ T |
Comparison Between Positioning characters (Tab) |
|
\ V |
Vertical Tab) |
|
\ W |
Equivalent to [A-Za-z0-9 _] |
/\ W/comparable to ". _! "A", "_", and "9" in "9 ″. |
\ W |
Equivalent to [^ A-Za-z0-9 _] |
/\ W/comparable to ". _! ".", "", "!" In 9 ", It can be seen that the function is opposite to/\ W. |
\ OOctal |
Comparison with the eight-in-one, of whichOctalIt is an octal number. |
/\ Oocetal123/compares the character value corresponding to "123" in the ASCII code with the octal. |
\ XHEX |
Compare to the hexadecimal position, whereHEXIs the hexadecimal number |
/\ Xhex38/can be equivalent to the character corresponding to "38" in the ASCII code that matches the hexadecimal value. |