Add support for long TLDs

Some trackers use top-level domains with more than 6 characters.

At the moment, the longest non-IDN TLD is 18-characters long (http://data.iana.org/TLD/tlds-alpha-by-domain.txt).
This commit is contained in:
Stéphane de Wit
2016-08-07 20:50:32 +02:00
committed by GitHub
parent d0f5a36a94
commit 7c7dcea7e1
+1 -1
View File
@@ -1,7 +1,7 @@
'use strict';
const regEx = {
domainName: /https?:\/\/(?:www\.)?([-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b)*(\/[\/\d\w\.-]*)*(?:[\?])*(.+)*/gi
domainName: /https?:\/\/(?:www\.)?([-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,18}\b)*(\/[\/\d\w\.-]*)*(?:[\?])*(.+)*/gi
};
module.exports = regEx;