... in which we look at one or two ways to make life easier when working with Python regular expressions. tl;dr: You can compose verbose regular expressions using fâ-âstrings. Here's a real-world example â instead of this: 1pattern = r"((?:\(\s*)?[A-Z]*H\d+[a-z]*(?:\s*\+\s*[A-Z]*H\d+[a-z]*)*(?:\s*[\):+])?)(.*?)(?=(?:\(\s*)?[A-Z]*H\d+[a-z]*(?:\s*\+\s*[A-Z]*H\d+[a-z]*)*(?:\s*[\):+])?(?![^\w\s])|$)"
{{#tags}}- {{label}}
{{/tags}}