Closed pascal-fischer closed 4 months ago
This PR fixes the isValidDomain regex to allow single char domain names like a.bc.com Tested the regex with the following set:
a.bc.com
console.log(isValidDomain("p.abc.com")); // true console.log(isValidDomain("example.com")); // true console.log(isValidDomain("invalid domain")); // false console.log(isValidDomain("a..b")); // false console.log(isValidDomain(".3.v")); // false console.log(isValidDomain("a-b.com")); // true console.log(isValidDomain("a.b")); // true console.log(isValidDomain("ab.bc.de")); // true console.log(isValidDomain("a-b.dc.de")); // true console.log(isValidDomain("a--b.com")); // false console.log(isValidDomain("-abc.com")); // false console.log(isValidDomain("abc-.com")); // false console.log(isValidDomain("abc..com")); // false
This PR fixes the isValidDomain regex to allow single char domain names like
a.bc.com
Tested the regex with the following set: