validDomain top-level constant
String
const validDomain
validDomain
is a constant RegExp pattern string used to validate
domain names by combining several smaller pattern strings, each
representing a different part or type of domain.
It is constructed as follows:
- It may optionally start with a validSubdomain, followed by
- a mandatory validDomainName, and ending with either
- a validGtld, or
- a validCctld, or
- a validPunycode.
Implementation
const validDomain =
'(?:$validSubdomain*$validDomainName(?:$validGtld|$validCctld|$validPunycode))';