The most important metacharacters are the Caret ( ^ ) and the Dollar Sign ( $ ).
The Caret ( ^ ) specifies the regular expression must match at the beginning of a string.
The Dollar sign ($) specifies the regular expression must match at the end of the string.
For example:
Example |
Description |
---|---|
THE |
Matches any word that contains the substring “THE”. For example, “THEATRE” or “SOOTHE”. |
^DAT |
Matches any word that begins with the substring “DAT”. For example, “DATE”, “DATUM”, or “DATO”. |
ING$ |
Matches any word that ends with the substring “ING”. For example, “WALKING” or “KING”. |