A domain-specific language (DSL) is designed for expressing solutions within a particular problem domain. Regular expressions are a DSL for describing text patterns: they have their own syntax and rules, separate from Python, and appear in tools ranging from command-line utilities to databases. section 8.3.2
Replacing vowels with a regular expression
The pattern '[aeiou]' describes a character class containing lowercase vowels. Python's re.sub() applies that pattern to text and replaces each match: re.sub('[aeiou]', 'o', 'Apples and bananas!') produces 'Applos ond bononos!'. A second substitution handles uppercase vowels. section 8.3.2
>>> pattern = '[aeiou]'
Inspect the compact regex pattern used to describe the vowels. section 8.3.2









