Character Classes

Learn how to group multiple characters into characteristic classes.

Allowing alternatives

When none of those metacharacters is specific enough, we can group multiple characters into a character class by enclosing them in square brackets. A character class allows us to treat a group of alternatives as a single atom:

Access this course and 1400+ top-rated courses and projects.