Symbol |
Describe |
Regular expressions |
Matched string |
Use Select one to match multiple regular expression patterns, also known as union or Logical or |
Re1| Re2 |
Match Regular expression Re1 or re2 |
Bat|bet|bit |
BAT, bet, bit |
Match any single character |
. |
Matches any character (except \ n), Includes letters, numbers, spaces (not including "\ n"), printable, and non-printable characters. Display the period symbol itself, you need to use "\." |
F.o |
Match any character before the letter "F" and "o"; for example Fao,f9o,f#o |
.. |
Any of two characters |
. end |
Matches any one character before the string "End" |
Match from start or end of string or word boundary |
^ or \a |
Match string Start part |
^dear |
Any string with dear as the starting point |
$ or \z |
Match string Termination section |
/bin/tesh$ |
Any string ending with/bin/tesh |
|
|
^subject:hi$ |
Any string consisting of a separate string Subject:hi |
\bbb |
Match the boundaries of a word |
\bthe |
Any string starting with the |
\bthe\b |
Just match the word the |
\b |
Match the pattern that appears in the middle of a word |
\bthe |
Any string that contains, but does not start with, the |
Creating character sets , scoping and negation |
[...] |
Match any single character from a character set |
B[aeiu]t |
BAT, bet, bit, but |
[CR] [23] [DP] [O2] |
A string containing four characters, such as C2DO\R3P2, etc. |
[.. X-y:] |
Matches any single character in the X~y range |
Z.[0-9] |
The letter "Z" followed by any character followed by a number |
[^...] |
does not match any one of the characters appearing in this character set, including a range of characters (if present in this character set) |
[^aeiou] |
A non-vowel character |
[^\t\n] |
Do not match tabs or \ n |
Using the closure operator for existence and frequency matching |
* |
Matches 0 or more occurrences of the preceding regular expression |
[a-za-z0-9]* |
|
+ |
Matches 1 or more occurrences of the preceding regular expression |
[a-z]+\.com |
|
? |
Matches a regular expression that appears before 0 or 1 times |
[Dn]ot? |
T appears once or does not appear, i.e. Do,no,dot,not |
{} |
{n} exactly matches the regular expression preceded by n times; {M,n} matches the regular expression that appears before the m~n-th |
[0-9] {15,16} |
Match 15 or 16 digits (such as a credit card number) |
|
|
</? [^>]+> |
Match all valid (and invalid) HTML tags |
A special character that represents a character set |
\d |
Match any decimal number equal to [0-9] |
\D{3}-\D{3}-\D{4} |
Format of US phone numbers |
\d |
does not match any non-numeric number, equals [^0-9] |
|
|
\w |
Matches any alphanumeric character equal to [a-za-z0-9] |
\[email protected]\w+\.com |
Simple e-mail address in [email protected] Format |
\w |
Does not match any alphanumeric number, equals [^a-za-z0-9] |
|
|
\s |
Match any space character equal to [\n\t\r\v\f] (\s opposite) |
|
|
Use parentheses to specify grouping |
(...) |
Match the closed regular expression, and then save as a subgroup; Use groups to embody |
\d+ (\.\d*)? |
A string representing a simple floating-point number; in other words, any decimal digit, followed by a decimal point and 0 or more decimal digits. |
Extended notation |
(?...) |
Provide a tag before the match is judged to achieve a pre-view (or post-visual) match or condition check |
|
|
(? P<name>, ...) |
|
|
|