Regex · URL slug · Free
URL slug regex.
Matches a lowercase, hyphen-separated URL slug with no leading, trailing, or doubled hyphens. Copy the pattern below, see what it matches, then tweak it for your exact case with the free generator.
The pattern
/^[a-z0-9]+(?:-[a-z0-9]+)*$/
✓ Matches
hello-worldai-regex-generatorpost123✗ Doesn't match
Hello-World-leadingdouble--hyphenNeed a variation? Generate one
Other common patterns
Parsing and pattern-matching are everywhere in AI systems. MindloomHQ teaches you to build them for real — agents, RAG, pipelines — with projects and certificates.
Explore MindloomHQ →