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)
3613
+
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
3615
3625
'(',// *** Capturing group $1, for a scheme-prefixed url (ex: http://google.com)
3616
3626
schemeRegex.source,
3617
-
domainNameRegex.source,
3627
+
getDomainNameStr(2),
3618
3628
')',
3619
3629
3620
3630
'|',
3621
3631
3622
-
'(',// *** Capturing group $2, for a 'www.' prefixed url (ex: www.google.com)
3623
-
'(//)?',// *** 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)
3632
+
'(',// *** Capturing group $4 for a 'www.' prefixed url (ex: www.google.com)
3633
+
'(//)?',// *** 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)
3624
3634
wwwRegex.source,
3625
-
domainNameRegex.source,
3635
+
getDomainNameStr(6),
3626
3636
')',
3627
3637
3628
3638
'|',
3629
3639
3630
-
'(',// *** Capturing group $4, for known a TLD url (ex: google.com)
3631
-
'(//)?',// *** 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)
3632
-
domainNameRegex.source+'\\.',
3640
+
'(',// *** Capturing group $8, for known a TLD url (ex: google.com)
3641
+
'(//)?',// *** 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)
3642
+
getDomainNameStr(10)+'\\.',
3633
3643
tldRegex.source,
3634
3644
'(?![-'+alphaNumericCharsStr+'])',// TLD not followed by a letter, behaves like unicode-aware \b
0 commit comments