You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varschemeRegex=/(?:[A-Za-z][-.+A-Za-z0-9]*:(?![A-Za-z][-.+A-Za-z0-9]*:\/\/)(?!\d+\/?)(?:\/\/)?)/,// match protocol, allow in format "http://" or "mailto:". However, do not match the first part of something like 'link:http://www.google.com' (i.e. don't match "link:"). Also, make sure we don't interpret 'google.com:8000' as if 'google.com' was a protocol here (i.e. ignore a trailing port number in this regex)
64
+
varschemeRegex=/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/,// match protocol, allow in format "http://" or "mailto:". However, do not match the first part of something like 'link:http://www.google.com' (i.e. don't match "link:"). Also, make sure we don't interpret 'google.com:8000' as if 'google.com' was a protocol here (i.e. ignore a trailing port number in this regex)
'(?:',// parens to cover match for scheme (optional), and domain
76
76
'(',// *** Capturing group $1, for a scheme-prefixed url (ex: http://google.com)
77
77
schemeRegex.source,
78
-
domainNameRegex.source,
78
+
getDomainNameStr(2),
79
79
')',
80
80
81
81
'|',
82
82
83
-
'(',// *** Capturing group $2, for a 'www.' prefixed url (ex: www.google.com)
84
-
'(//)?',// *** Capturing group $3 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character (handled later)
83
+
'(',// *** Capturing group $4 for a 'www.' prefixed url (ex: www.google.com)
84
+
'(//)?',// *** Capturing group $5 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character (handled later)
85
85
wwwRegex.source,
86
-
domainNameRegex.source,
86
+
getDomainNameStr(6),
87
87
')',
88
88
89
89
'|',
90
90
91
-
'(',// *** Capturing group $4, for known a TLD url (ex: google.com)
92
-
'(//)?',// *** Capturing group $5 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character (handled later)
93
-
domainNameRegex.source+'\\.',
91
+
'(',// *** Capturing group $8, for known a TLD url (ex: google.com)
92
+
'(//)?',// *** Capturing group $9 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character (handled later)
93
+
getDomainNameStr(10)+'\\.',
94
94
tldRegex.source,
95
95
'(?![-'+alphaNumericCharsStr+'])',// TLD not followed by a letter, behaves like unicode-aware \b
0 commit comments