summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-10 21:55:56 -0500
committerJune 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 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) {
14Add shotty -dJune McEnroe 2019-07-13Add shotty -cJune McEnroe 2019-07-13Add DL to shottyJune McEnroe 2019-07-12Color html rather than bodyJune McEnroe If background-color is only set on body then overscroll in Safari reveals white. 2019-07-12Make author consistent and update URLsJune McEnroe 2019-07-12Move to www/text.causal.agencyJune McEnroe 2019-07-12Add new causal.agency with shotty shotsJune McEnroe 2019-07-12Use -s to infer terminal sizeJune McEnroe 2019-07-12Add DCH to shottyJune McEnroe This makes htop mostly work. Scrolling region still missing. 2019-07-12Support insert mode in shottyJune McEnroe This is how curses puts characters into the bottom-right cell of the terminal. 2019-07-11Don't do carriage return on line feedJune McEnroe 2019-07-11Interpret 256color-style SGRsJune McEnroe 2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe 2019-07-11Factor out clearJune McEnroe 2019-07-11Add bright option to shottyJune McEnroe 2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe 2019-07-10Ignore SM and RMJune McEnroe 2019-07-09Add shotty man page and build itJune McEnroe 2019-07-09Add up -cJune McEnroe 2019-07-09Add options for default colors to shottyJune McEnroe 2019-07-08Use char literals consistentlyJune McEnroe