Matching Sequences

You can build a regular expression to match a sequence of characters. These sequences, called “character classes”, simply place a set of characters side-by-side within square brackets “[]”. An item in a character class can be either an ordinary character, representing itself, or a metacharacter, performing a special function. This primer covers how to build simple character classes, prevent matches with character classes, and construct compound character classes with metacharacters.