@technobuddha > library > RegExp > Constants
Constant: domain
ts
const domain: RegExp;Defined in: regexp.ts:194
Regular expression for matching a domain name composed of a host and a top-level domain (TLD).
Example
typescript
domain.test('example.com'); // true
domain.test('sub.example.co'); // true
domain.test('invalid_domain'); // false