From 0e1fcbee2e83137a3ddcaad4fd732656cd941b41 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 10 Feb 2020 21:55:56 -0500 Subject: Match URLs inside parens or with paired parens inside --- bin/title.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/title.c b/bin/title.c index d85fa9ac..9cf444e8 100644 --- a/bin/title.c +++ b/bin/title.c @@ -190,7 +190,7 @@ int main(int argc, char *argv[]) { char *buf = NULL; size_t cap = 0; - regex_t urlRegex = regex("https?://[^[:space:]>\"]+", 0); + regex_t urlRegex = regex("https?://([^[:space:]>\"()]|[(][^)]*[)])+", 0); while (0 < getline(&buf, &cap, stdin)) { regmatch_t match = {0}; for (char *ptr = buf; *ptr; ptr += match.rm_eo) { -- cgit 1.4.1