fix: tld length in url regex

according to a random stackoverflow answer DNS allows 1 - 63 range.
This commit is contained in:
ChomeNS
2025-03-30 18:22:57 +07:00
parent 821bfe2626
commit e68f4c874c

View File

@@ -27,7 +27,7 @@ public class ComponentUtilities {
.builder()
.match(Pattern
.compile("((https?://(ww(w|\\d)\\.)?|ww(w|\\d))[-a-zA-Z0-9@:%._+~#=]{1,256}"
+ "\\.[a-zA-Z0-9]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&/=]*))"))
+ "\\.[a-zA-Z0-9]{1,63}\\b([-a-zA-Z0-9@:%_+.~#?&/=]*))"))
.replacement((b, c) -> {
if (c == null) {
return null;