Write a pattern that matches exactly what you meant and predict what it will cost, by deriving the machine a pattern turns into and counting the steps that machine takes on the input you are worried about
Describing a Pattern in Text

Patterns in text, derived from the machine they compile to, including why one of them once took thirty seconds on a forty character line.
8 lessons, written and corrected before you arrived. Reading them here needs no account. The first reads the whole way through; the others open and then stop, because a page nobody owns cannot tell who is reading it. Starting the course gives you your own copy, where every idea has problems standing under it and you can ask about any sentence.