diff options
author | June McEnroe <june@causal.agency> | 2020-02-10 21:55:56 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-02-10 21:55:56 -0500 |
commit | 01277ec3b470b16087d5c758e7e674638adeafd9 (patch) | |
tree | 7163b1e3cf42e26b1c4f6089b91df0d6deb79396 /bin | |
parent | Duplicate effective URL before passing it back to curl (diff) | |
download | src-01277ec3b470b16087d5c758e7e674638adeafd9.tar.gz src-01277ec3b470b16087d5c758e7e674638adeafd9.zip |
Match URLs inside parens or with paired parens inside
Diffstat (limited to 'bin')
-rw-r--r-- | bin/title.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/title.c b/bin/title.c index 0168e2c9..24d4e8eb 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) { |