Test, validate and match regular expressions
Matches URL slugs in kebab-case: lowercase letters and digits separated by single hyphens. The negative lookahead (?!-) and lookbehind (?<!-) ensure the slug cannot start or end with a hyphen, while the pattern structure prevents consecutive hyphens. Useful for validating permalinks, URL slugs, or identifiers like 'my-blog-post-2024'. The gm flags enable matching multiple slugs across separate lines.