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
Currently the URL pattern doesn't match IP and IP:PORT hostnames.
It supports only FQDN because the regex requires the TLD to be present.
Current regex
/(https?://|www.)[-a-zA-Z0-9@:%.+~#=]{2,256}.[a-z]{2,6}\b([-a-zA-Z0-9@:%+.~#?&//=]*)/i
Proposed regex
/(https?://|www.)[-a-zA-Z0-9@:%.+~#=]{2,256}(.[a-z]{2,6})?\b([-a-zA-Z0-9@:%+.~#?&//=]*)/i
if not very clear by bolding, .[a-z]{2,6} became (.[a-z]{2,6})?
Ideally the URL pattern should be according to RFC 3986 or the newer version RFC 7595
The text was updated successfully, but these errors were encountered:
fbartho
changed the title
Improving URL pattern
Support IP & IP:PORT hostnames in Improving URL pattern
Nov 15, 2018
fbartho
changed the title
Support IP & IP:PORT hostnames in Improving URL pattern
Support IP & IP:PORT hostnames in URL pattern
Nov 15, 2018
@webraptor
I worry that this would start matching undesirable things as so many chunks are optional.
If you want to submit a PR we could potentially see what it looks like & add tests.
Alternatively, obviously, you can override the regexp yourself for some components, or you can in the next release directly patch the PATTERNS table, if you want to apply this fix globally for yourself.
Currently the URL pattern doesn't match IP and IP:PORT hostnames.
It supports only FQDN because the regex requires the TLD to be present.
Current regex
/(https?://|www.)[-a-zA-Z0-9@:%.+~#=]{2,256}.[a-z]{2,6}\b([-a-zA-Z0-9@:%+.~#?&//=]*)/i
Proposed regex
/(https?://|www.)[-a-zA-Z0-9@:%.+~#=]{2,256}(.[a-z]{2,6})?\b([-a-zA-Z0-9@:%+.~#?&//=]*)/i
if not very clear by bolding, .[a-z]{2,6} became (.[a-z]{2,6})?
Ideally the URL pattern should be according to RFC 3986 or the newer version RFC 7595
The text was updated successfully, but these errors were encountered: