Metacharacter | Description |
---|---|
|
Form feed |
|
Line feed |
|
Carriage return |
|
Tab |
|
Vertical tab |
Matching \
To Match \
To match the backslash character itself (\
), you would need to use \\\
.
\
or \\
? Most regular expression implementation use a single backslash to escape special characters to be able to use them as literals. MySQL, however, requires two backslashes (MySQL itself interprets one and the regular expression library interprets the other).
Matching Character Classes
There are matches that you'll find yourself using frequently, digits, or all alphabetical characters, or all alphanumerical characters, and so on. To make working with these easier, you may use predefined character sets known as character classes. Following table lists the character classes and what they mean.
Character Classes
Class | Description |
---|---|
|
Any letter or digit, (same as |
|
Any letter (same as |
|
Space or tab (same as |
|
ASCII control characters (ASCII |
|
Any digit (same as |
|
Same as |
|
Any lowercase letter (same as |
|
Any printable character |
|
Any character that is neither in |
|
Any whitespace character including the space (same as |
|
Any uppercase letter (same as |
|
Any hexadecimal digit (same as |