summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorC. McEnroe <june@causal.agency>2020-02-10 21:55:56 -0500
committerC. McEnroe <june@causal.agency>2020-02-10 21:55:56 -0500
commit0e1fcbee2e83137a3ddcaad4fd732656cd941b41 (patch)
tree4bb10ef5016f38d4c4a64e52922ed409cf5d6cbe
parentDuplicate effective URL before passing it back to curl (diff)
downloadsrc-0e1fcbee2e83137a3ddcaad4fd732656cd941b41.tar.gz
src-0e1fcbee2e83137a3ddcaad4fd732656cd941b41.zip
Match URLs inside parens or with paired parens inside
-rw-r--r--bin/title.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/title.c b/bin/title.c
index d85fa9a..9cf444e 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) {