Basic regular expression construct
Regular expressions are made up of two types of characters: normal text characters, called literals, and special characters, such as the asterisk (*, +, ?, .), called metacharacters. There are times when you want to match a metacharacter as a literal character. In such cases, we prefix that metacharacter with a backslash (\), which is called an escape sequence.
The basic regular expression construct can be summarized as follows:
Here is the list of metacharacters, also known as special characters, that are used in building regular expressions:
\ ^ $ . [ ] | ( ) * + ?
The following table lists the remaining elements that are used in building a basic regular expression, apart from the metacharacters mentioned ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access