URL Slug Regular Expression

Category: URI

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:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.