Problems / Slugify Article Titles / Editorial
lower(title)
[^a-z0-9]
regexp_replace(..., '[^a-z0-9]+', '-', 'g')
+
" & "
'g'
'^-+|-+$'
Text normalization pipelines are best built as ordered, idempotent passes — lowercase, canonicalize separators, trim — where each pass makes the next one simpler, and running the pipeline twice changes nothing. The two classic slugify bugs are both single-flag mistakes: forgetting 'g' (only the first junk run collapses) and forgetting the + (every junk character becomes its own hyphen, yielding sql---duckdb). Idempotence is the property to test for: a correct slug, slugified again, must come back unchanged.
sql---duckdb
Solve Slugify Article Titles yourself →