AG
Regex
AGREGEX
About
Cheat Sheet
Pattern Library
Guides
Contact
한국어
English
日本語
中文
Español
Português
Français
Deutsch
Русский
العربية
Bahasa Indonesia
← Pattern Library
PATTERN
URL Slug
Regex Pattern
Web · URL
/
^[a-z0-9]+(?:-[a-z0-9]+)*$
/
Copy
/^[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
URL
← Pattern Library