aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-01-30 10:53:52 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-02-05 12:35:16 +0000
commit6d344f82ee151eb202dd786a63c12492f48fa4b8 (patch)
treecfaf17d6f44c7be1779315af39063474c085dbc2
parenturl-mode: wip: regex: don't allow {}, do allow matched [] (diff)
url-mode: wip: regex: mention changes from original regex
-rw-r--r--url-mode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/url-mode.c b/url-mode.c
index 83cb4982..9aac9be0 100644
--- a/url-mode.c
+++ b/url-mode.c
@@ -380,7 +380,11 @@ regex_detected(const struct terminal *term, enum url_action action, url_list_t *
}
}
- // https://gist.github.com/gruber/249502
+ /*
+ * Based on https://gist.github.com/gruber/249502, but modified:
+ * - Do not allow {} at all
+ * - Do allow matched []
+ */
regex_t preg;
const char *regex_string =
"("