A character class matches one character from a specified set. Square brackets define the set, while a dash defines a range: [a-z] matches any lowercase letter from a through z. section 1.5.2
Character classes become useful when building precise greeting patterns. Adding * after [a-z] allows any number of consecutive lowercase letters; related expressions can combine classes with whitespace, punctuation, exclusions, and bounded repetitions. section 1.5.2
Recognizing greeting names
A Python regular expression can match greetings such as “Hello Rosa” and “Good evening Rosa,” then capture the name for downstream chatbot logic. Pattern matching remains brittle: an unexpected wording such as “Good Manning Rosa” can fail. section 1.5.2








