mirror of
https://github.com/tiennm99/is-a-good-dev.git
synced 2026-10-12 20:15:50 +00:00
Update utils.js to add support for multi level domains.
This commit is contained in:
1 parent
7d302fde71
commit
dfbd82500c
1 file changed
+1
-1
+1
-1
@@ -7,7 +7,7 @@ module.exports.checkIfValidIP = function(str) {
|
||||
|
||||
module.exports.checkIfValidFQDN = function(str) {
|
||||
// Regular expression to check if string is a FQDN
|
||||
const regexExp = /^(?!:\/\/)([a-zA-Z0-9-_]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,63}?$/gi
|
||||
const regexExp = /(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)/gi
|
||||
|
||||
return regexExp.test(str);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user