The current URL regex matches some strings that are not valid URLs, such as 1.0 and ///.///, and fails to match some valid URLs. The new regular expression, while not exactly aligned with the URI format defined in RFC 3986, is much more robust. It also supports Bukkit color codes, unlike the library proposed in #93.
The current URL regex matches some strings that are not valid URLs, such as
1.0
and///.///
, and fails to match some valid URLs. The new regular expression, while not exactly aligned with the URI format defined in RFC 3986, is much more robust. It also supports Bukkit color codes, unlike the library proposed in #93.Sample URL:
https://user:pass@github.com:433/Aust1n46/VentureChat?tab=readme-ov-file
((?:[a-zA-Z&][a-zA-Z+\-.&]*)://)?
https
(?:([^\s:@]*)(?::([^\s@]*))?@)?
user:pass
((?:[a-zA-Z0-9\-.&]*[a-zA-Z0-9])+\.[a-zA-Z\-&]{2,}\|(?:[&0-9]{1,3}\.[&0-9]{1,3}\.[&0-9]{1,3}\.[&0-9]{1,3}))
github.com
(?::([&0-9]{1,5}))?
443
(/[^\s?]*)*
/Aust1n46/VentureChat
(?:\?([^\s]*))?
tab=readme-ov-file