From a9ca4d8dac5f5cd8b6b075c4858b9b2915e3fcd1 Mon Sep 17 00:00:00 2001 From: "Mingde (Matthew) Zeng" Date: Fri, 31 Jan 2020 14:35:28 -0500 Subject: [PATCH] Update url regex --- eaf.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eaf.el b/eaf.el index 62ebf38..42307da 100644 --- a/eaf.el +++ b/eaf.el @@ -1067,7 +1067,7 @@ If URL is an invalid URL, it will use `eaf-browser-default-search-engine' to sea ;; Validate URL legitimacy (if (or ;; Normal url address. - (string-match "^\\(https?://\\)?[a-z0-9]+\\([-.][a-z0-9]+\\)*.+\\..+[a-z0-9.]\\{2,5\\}\\(:[0-9]{1,5}\\)?\\(/.*\\)?$" url) + (string-match "^\\(https?://\\)?[a-z0-9]+\\([-.][a-z0-9]+\\)*.+\\..+[a-z0-9.]\\{1,6\\}\\(:[0-9]{1,5}\\)?\\(/.*\\)?$" url) ;; Localhost url. (string-match "^\\(https?://\\)?\\(localhost\\|127.0.0.1\\):[0-9]+/?" url)) (progn @@ -1096,7 +1096,7 @@ This function works best if paired with a fuzzy search package." (history-url (when (string-match "[^\s]+$" history) (match-string 0 history)))) (if (and history-url - (string-match "^\\(https?://\\)?[a-z0-9]+\\([-.][a-z0-9]+\\)*.+\\..+[a-z0-9.]\\{2,5\\}\\(:[0-9]{1,5}\\)?\\(/.*\\)?$" history-url)) + (string-match "^\\(https?://\\)?[a-z0-9]+\\([-.][a-z0-9]+\\)*.+\\..+[a-z0-9.]\\{1,6\\}\\(:[0-9]{1,5}\\)?\\(/.*\\)?$" history-url)) (eaf-open-browser history-url) (eaf-open-browser history))) (call-interactively 'eaf-open-browser))))