diff --git a/termux-shared/src/main/java/com/termux/shared/termux/data/TermuxUrlUtils.java b/termux-shared/src/main/java/com/termux/shared/termux/data/TermuxUrlUtils.java index 6eabde8eab..d35d9f81d1 100644 --- a/termux-shared/src/main/java/com/termux/shared/termux/data/TermuxUrlUtils.java +++ b/termux-shared/src/main/java/com/termux/shared/termux/data/TermuxUrlUtils.java @@ -60,7 +60,7 @@ public static Pattern getUrlMatchRegex() { regex_sb.append("(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|"); // Host name or domain. - regex_sb.append("(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))?|"); + regex_sb.append("(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*){1,}[a-z\\u00a1-\\uffff0-9]{1,}))?|"); // Just path. Used in case of 'file://' scheme. regex_sb.append("/(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)");