diff options
author | Wenxuan <wenxuangm@gmail.com> | 2021-06-02 09:04:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 09:04:00 +0800 |
commit | 11fd83d8d4fab6a814801b63e3c67d885606a366 (patch) | |
tree | 5457a0b0aa9cdde65aff38f48cad57ea2dfc83d8 | |
parent | 6b2c50fb1b5d39459b6b7841d755a294dd6c497b (diff) | |
parent | 2952852499c4ffc805e14e30e41badfedc7d4583 (diff) | |
download | fork-tmux-fzf-url-11fd83d8d4fab6a814801b63e3c67d885606a366.tar.gz fork-tmux-fzf-url-11fd83d8d4fab6a814801b63e3c67d885606a366.tar.bz2 fork-tmux-fzf-url-11fd83d8d4fab6a814801b63e3c67d885606a366.zip |
Merge pull request #18 from nifr/fix/duplicate-entries-in-fzf-selection
fix: urls of the form "https://www.*" show up twice in fzf selection
closes #17
-rwxr-xr-x | fzf-url.sh | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -36,7 +36,7 @@ else fi mapfile -t urls < <(echo "$content" |grep -oE '(https?|ftp|file):/?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]') -mapfile -t wwws < <(echo "$content" |grep -oE 'www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/') +mapfile -t wwws < <(echo "$content" |grep -oE '(http?s://)?www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' | grep -vE '^https?://' |sed 's/^\(.*\)$/http:\/\/\1/') mapfile -t ips < <(echo "$content" |grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9]{1,5})?(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/') mapfile -t gits < <(echo "$content" |grep -oE '(ssh://)?git@\S*' | sed 's/:/\//g' | sed 's/^\(ssh\/\/\/\)\{0,1\}git@\(.*\)$/https:\/\/\2/') |