URL Slug Regular Expression

A regular expression to parse and validate user-friendly URL slugs.

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

URL Slug Examples:

  • url-slug-regular-expression
  • url-slug

See Also: