Web
#slug
#url
#web
#cms
URL Slug
Valid URL slug — lowercase alphanumeric characters separated by single hyphens, no leading or trailing hyphens.
✓ CMS permalink generation✓ URL route validation✓ SEO slug sanitization
✓ Valid Examples
- my-blog-post
- hello
- article-123
- regex-to
✗ Invalid Examples
- My-Post
- -starts-with-hyphen
- ends-with-hyphen-
- has--double
Usage & Integration
Validate URL Slug natively in your backend or frontend without copying regex strings.
Node / Edge
import { validate } from '@regexto/validators';
validate('slug', '...');Python
from regexto_validators import validate
validate("slug", "...")Go
import "github.com/regex-to/validators-go"
valid, err := validators.Validate("slug", "...")PHP
use RegexTo\Validators\Validator;
Validator::validate('slug', '...');Rust
use regexto_validators::validate;
let is_valid = validate("slug", "...").unwrap();