A list of characters contained in square brackets matches against any one of the characters in the list.
For example:
Example |
Description |
---|---|
^[ABC]$ |
Matches either “A”, “B”, or “C” |
^[0-9ABC]$ |
Matches either “A”, “B”, “C”, or a single digit. A hyphen can be used to specify a range. |