Defining Regular Expressions
At the highest level, a regular expression is one or more branches separated by the vertical bar character (|). This character is considered to have the properties of a logical-OR. Any of the branches could match with an evaluated string. Table 16-1 provides a few examples.
Each branch contains one or more atoms. These atoms may be followed by characters that modify the number of times the atom may be matched in succession. An asterisk (*) means the atom can match any number of times. A plus sign (+) means the atom must match at least once. A question mark (?) signifies that the atom may match once or not at all.
Alternatively, the atom may be bound, which means it is followed by curly braces, { and }, that contain ...
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