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 validationLink parsingDomain registration checks
/
/
Risk
Test String
4 matches
(?:…)+Non-capturing groupNon-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 groupNon-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-za-z — range from 'a' to 'z'
A-ZA-ZA-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();