Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Internet
#domain
#internet
#dns
#hostname

Domain Name

Matches a valid domain name including subdomains and international TLDs.

✓ DNS validation✓ Link parsing✓ Domain registration checks
/
/
Safe
Test String
4 matches
(?:…)+Non-capturing group— Non-capturing group — groups without capturing (no index assigned) — repeated one or more times (greedy) · + — one or more times (greedy)
[…]Character class […]— Matches any single character listed in this set
(?:…)?Non-capturing group— Non-capturing group — groups without capturing (no index assigned) — repeated zero or one time (optional) · ? — zero or one time (optional)
\.\.— \. — escaped character '.'
[…]{2,}Character class […]— Matches any single character listed in this set — repeated at least 2 times · {2,} — at least 2 times
a-za-z— a-z — range from 'a' to 'z'
A-ZA-Z— A-Z — range from 'A' to 'Z'
Pattern: 65 charsInput: 48 chars
100% client-side · private

✓ Valid Examples

  • example.com
  • sub.domain.co.uk
  • my-site.io
  • regex.to

✗ Invalid Examples

  • -invalid.com
  • invalid-.com
  • .com
  • localhost

Usage & Integration

Validate Domain Name natively in your backend or frontend without copying regex strings.

Node / Edge

import { validate } from '@regexto/validators';

validate('domain', '...');

Python

from regexto_validators import validate

validate("domain", "...")

Go

import "github.com/regex-to/validators-go"

valid, err := validators.Validate("domain", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('domain', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("domain", "...").unwrap();