Character |
Description |
| \ |
Mark the next character as a special character or text. For example, "N" matches the character "N. "\ N" matches the line feed character. The sequence "\" matches with "\", while "\ (" matches. |
| ^ |
Matches the start of the input. |
| $ |
Matches the end of the input. |
| * |
Match the first character Zero or multiple times. For example, "zo *" matches "Z" or "Zoo. |
| + |
Match the previous character once or multiple times. For example, "zo +" matches "Zoo", but does not match "Z. |
| ? |
Match the first character Zero or once. For example, "? Ve? "Matches" ve "in" never. |
| . |
Match any single character except line breaks. |
| (Pattern) |
MatchPatternRemember the match. You can use the item[0]... [N]From the generatedMatchesCollection. To match the parentheses (), use "\ (" or "\)". |
| X|Y |
MatchXOr Y. For example, "z | food" matches "Z" or "food. "(Z | f) Ood" matches "Zoo" or "food ". |
| {N} |
NIt is a non-negative integer. A total of N matches. For example, "O {2}" and "O" in "Bob" do not match, but match the first two o in "foooood. |
| {N,} |
N is a non-negative integer. Match at least N times. For example, "O {2,}" does not match "O" in "Bob", but matches all o in "foooood. "O {1,}" is equivalent to "O +. "O {0,}" is equivalent to "O. |
| {N,M} |
M and n are non-negative integers. Match at least N times and at most m times. For example, the first three o matches in "o {}" and "fooooood. "O {0, 1}" and "O? "Equivalent. |
| [ XYZ] |
Character Set combination. Match any character in the brackets. For example, "A" in "[ABC]" and "plain" matches. |
| [^XYZ] |
Negative Character Set combination. Match any character that is not in parentheses. For example, "[^ ABC]" matches "P" in "[^ ABC]" and "plain. |
| [A-z] |
Character range. Matches any character in the specified range. For example, "[A-Z]" matches 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]" matches 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 "er" in "never", but does not match "er" in "verb. |
| \ B |
Match non-word boundary. "EA * r \ B" matches "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. It is equivalent to "[\ f \ n \ r \ t \ v. |
| \ S |
Match any non-blank characters. It is equivalent to "[^ \ f \ n \ r \ t \ v. |
| \ T |
Match tabulation characters. |
| \ V |
Match vertical tabs. |
| \ W |
Match any characters including underscores. It is equivalent to "[A-Za-z0-9. |
| \ W |
Match any non-character. It is equivalent to "[^ A-Za-z0-9. |
| \Num |
MatchNum, WhereNumIs a positive integer. Returns a matched reference. For example, "(.) \ 1" matches two consecutive identical characters. |
| \N |
Match n, where N is the octal value. The octal value must be 1, 2, or 3 characters long. For example, "\ 11" and "\ 011" Both match tabulation characters. "\ 0011" and "\ 001" & "1" are equivalent. The octal value must be at least 256. If it is exceeded, only the first two digits constitute the expression. ASCII code can be used in regular expressions. |
| \ XN |
Match n, whereNIs the hexadecimal value. The hexadecimal value must be exactly two characters long. For example, "\ x41" matches ". "\ X041" and "\ x04" & "1" are equivalent. ASCII code can be used in regular expressions. |