Back to Library
Web

URL Slug

Matches valid URL slugs (kebab-case).

Pattern
^[a-z0-9]+(?:-[a-z0-9]+)*$

Test Cases

my-blog-post Match
Invalid Slug No Match

Try it Live

Test and customize this pattern in our interactive editor

Open in Editor