Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

A constraint for Symfony's Validator component to test if a value is a valid domain name.

License

Notifications You must be signed in to change notification settings

phenaproxima/DomainConstraint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DomainConstraint

A constraint for Symfony's Validator component to test if a value is a valid domain name.

The value is tested against the rules at http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names

  • At least two period-delimited segments
  • Cannot start or end with a period
  • Each segment must be between 1 and 63 characters
  • The entire thing is no greater than 255 characters
  • Valid characters are 'a' to 'z', 'A' to 'Z', '0' to '9', and hyphen (-)
  • Labels cannot start or end with a hyphen
  • The last segment must be a support top-level domains (and there are a LOT of strange ones)

About

A constraint for Symfony's Validator component to test if a value is a valid domain name.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages