Character |
Description |
\ |
Mark the next character as a special character or text. For example, "N" Match the character "N. "\ N" Match the line feed character. Sequence "\" and "\" And "\ (" matches. |
^ |
Matches the start of the input. |
$ |
Matches the end of the input. |
* |
Match the first character Zero or multiple times. For example, "zo *" Match with "Z" or "Zoo. |
+ |
Match the previous character once or multiple times. For example, "zo +" It matches "Zoo", but does not match "Z. |
? |
Match the first character Zero or once. For example, "? Ve? " Match "ve" in "never. |
. |
Match any single character except line breaks. |
(Pattern) |
MatchPattern Remember the match. You can use the item[0]... [N]From the generated MatchesCollection. To match the parentheses (), use "\ (" Or "\)". |
X|Y |
MatchXOr Y. For example, "z | food" and "z" or "food" Match. "(Z | f) Ood" matches "Zoo" or "Food ". |
{N} |
NIt is a non-negative integer. Total match n Times. For example, in "o {2}" and "Bob ", "O" does not match, but it does not match the first two Match. |
{N,} |
N is a non-negative integer. Match at least N Times. For example, in "o {2,}" and "Bob ", "O" does not match, but it does not match all o in "foooood" Match. "O {1,}" is equivalent to "O +. "O {0 ,}" It is equivalent to "O. |
{N,M} |
M and n are non-negative integers. Match at least N And match up to m times. For example, "O {1, 3}" and The first three o matches in "fooooood. "O {0, 1}" and "O? "Equivalent. |
[ XYZ ] |
Character Set combination. Match any character in the brackets. For example, "[ABC]" Matches "A" in "plain. |
[^XYZ ] |
Negative Character Set combination. Match any character that is not in parentheses. For example, "[^ ABC]" Matches "P" in "plain. |
[A-z] |
Character range. Matches any character in the specified range. For example, "[A-Z]" Match any lowercase letter in the range of "A" to "Z. |
[^M-z] |
Negative character range. Matches any character that is not within the specified range. For example, "[M-Z]" Match any character that is not in the range of "M" to "Z. |
\ B |
Match the boundary of a word, that is, the position between the word and the space. For example, "Er \ B" Matches with "er" in "never", "Er" in "verb" does not match. |
\ B |
Match non-word boundary. "EA * r \ B" Match "ear" in "never early. |
\ D |
Match numeric characters. It is equivalent to [0-9]. |
\ D |
Match non-numeric characters. It is equivalent to [^ 0-9]. |
\ F |
Match the form character. |
\ N |
Match line breaks. |
\ R |
Match the carriage return character. |
\ S |
Match any blank spaces, including spaces, tabulation, and page feed. And "[\ F \ n \ r \ t \ v]" is equivalent. |
\ S |
Match any non-blank characters. And "[^ \ f \ n \ r \ t \ v]" Equivalent. |
\ T |
Match tabulation characters. |
\ V |
Match vertical tabs. |
\ W |
Match any characters including underscores. And "[A-Za-z0-9 _]" is equivalent. |
\ W |
Match any non-character. And "[^ A-Za-z0-9 _]" is equivalent. |
\Num |
MatchNum, WhereNum Is a positive integer. Returns a matched reference. For example, "(.) \ 1" Match two consecutive identical characters. |
\N |
Match n, where n It is an octal value for changing codes. The octal value must be 1, 2, or 3. Bit Length. For example, "\ 11" and "\ 011" All match tabulation characters. "\ 0011" and "\ 001 "& "1" is equivalent. The octal value must be at least 256. If it is exceeded, only the first two digits constitute the expression. Use in Regular Expressions ASCII code. |
\ XN |
Match n, whereN Is the hexadecimal value. The hexadecimal value must be exactly two characters long. For example, "\ x41" Match with ". "\ X041" and "\ x04" & "1" is equivalent. Use in Regular Expressions ASCII code. |