From f2faf93fabf741730d6c4773b627837dcc81f43f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 28 Apr 2020 18:48:43 -0400 Subject: [PATCH] regex update --- config.h | 2 +- st-urlhandler | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 8ddd69c..a271d92 100644 --- a/config.h +++ b/config.h @@ -224,7 +224,7 @@ MouseKey mkeys[] = { static char *openurlcmd[] = { "/bin/sh", "-c", "st-urlhandler", "externalpipe", NULL }; static char *copyurlcmd[] = { "/bin/sh", "-c", - "tmp=$(sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?$#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)' | uniq | sed 's/^www./http:\\/\\/www\\./g' ); IFS=; [ ! -z $tmp ] && echo $tmp | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", + "tmp=$(sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./@$&%?$#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)' | uniq | sed 's/^www./http:\\/\\/www\\./g' ); IFS=; [ ! -z $tmp ] && echo $tmp | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", "externalpipe", NULL }; static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL }; diff --git a/st-urlhandler b/st-urlhandler index 5833883..d44bb99 100755 --- a/st-urlhandler +++ b/st-urlhandler @@ -1,6 +1,6 @@ #!/bin/sh -urlregex="(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./@&%?$#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)" +urlregex="(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./@$&%?$#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)" # First remove linebreaks and mutt sidebars: urls="$(sed 's/.*│//g' | tr -d '\n' |