Regular Expressions Character classes Match different, similar words


Example

Consider the character class [aeiou]. This character class can be used in a regular expression to match a set of similarly spelled words.

b[aeiou]t matches:

  • bat
  • bet
  • bit
  • bot
  • but

It does not match:

  • bout
  • btt
  • bt

Character classes on their own match one and only one character at a time.