Exercise 1: A Real Slug Converter — Possible Solution ==================================================================== ADDING THE CONVERTER ------------------------------ CONVERTERS['slug'] = (r'[a-z0-9]+(?:-[a-z0-9]+)*', str) router = Router() router.add_route( 'GET', '/posts/', lambda **p: f"Post: {p['title']}", name='post_detail', ) The regex requires the whole segment to be one or more runs of lowercase letters/digits, each run after the first separated by a single hyphen - it rejects a leading/trailing hyphen, a double hyphen, and any uppercase letter, space, or punctuation outright. VERIFIED AGAINST BOTH REAL PATHS ------------------------------ /posts/hello-world-42 -> MATCH Post: hello-world-42 /posts/Hello World! -> 404 (no route's pattern matched) WHY THIS WORKS AS AN ANSWER ------------------------------ It reuses the exact (regex, cast) shape every other CONVERTERS entry already follows, so Router._compile() needs no changes at all to pick it up - and it verifies both a real accept and a real reject on the finished route, not just that the regex compiles, confirming the slug converter actually behaves the way a URL slug is supposed to.