← Pattern Library PATTERN
Web · URL
/^[a-z0-9]+(?:-[a-z0-9]+)*$/
Web · URL Flags:
Description
Validates an entire URL slug made up only of lowercase letters, digits, and hyphens. Consecutive hyphens or hyphens at the start or end are not allowed. Used to check the address format of blogs and documents.
Example Matches
my-post-title
regex-101
Test String
my-post-title
Open this pattern in the tester
Other Patterns