Chapter 3
Regular Expressions
Section 3
Character Classes
We've learned about the dot, pipe, atoms, and their modifiers, but now we need to learn about character classes. A character class is a way of organizing characters that have similar properties, such as vowels ("aeiou") and numbers ("0123456789"). - A character class is defined with square braces. A regular expression will try to match any one character inside the character class. We can define lowercase vowels using "[aeiou]" - Character classes for every letter of the alphabet can be long and prone to error. We solve this problem with ranges. The range for uppercase letters is "[A-Z]" - We can negate a character class using the carat symbol as the first character. The character class of lowercase vowels is "[aeiou]", but the character class of everything that isn't a lowercase vowel is "[^aeiou]"