aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfzf-url.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/fzf-url.sh b/fzf-url.sh
index 48dcc45..04a6060 100755
--- a/fzf-url.sh
+++ b/fzf-url.sh
@@ -17,6 +17,7 @@ fi
content="$(tmux capture-pane -J -p)"
urls=($(echo "$content" |grep -oE '\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]'))
+wwws=($(echo "$content" |grep -oE 'www(\.[^\.]+)+' | sed 's/\(.*\)/http:\/\/\1/'))
ips=($(echo "$content" |grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9].*)?' | sed 's/\(.*\)/http:\/\/\1/'))
merge() {
@@ -25,7 +26,7 @@ merge() {
done
}
-merge "${urls[@]}" "${ips[@]}" |
+merge "${urls[@]}" "${wwws[@]}" "${ips[@]}"|
sort -u |
nl -w3 -s ' ' |
fzf_cmd |