From 40cc006bab0b2510b0a70f713d3a756517c007b7 Mon Sep 17 00:00:00 2001 From: Wenxuan Date: Sun, 15 Apr 2018 12:49:31 +0800 Subject: Fix www matching regex --- fzf-url.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fzf-url.sh b/fzf-url.sh index 4833d72..8978ae0 100755 --- a/fzf-url.sh +++ b/fzf-url.sh @@ -6,7 +6,7 @@ #=============================================================================== fzf_cmd() { - fzf-tmux -d 30% --multi --exit-0 --cycle --reverse --bind='ctrl-r:toggle-all' --bind='ctrl-s:toggle-sort' + fzf-tmux -d 35% --multi --exit-0 --cycle --reverse --bind='ctrl-r:toggle-all' --bind='ctrl-s:toggle-sort' } if hash xdg-open &>/dev/null; then @@ -17,8 +17,8 @@ fi content="$(tmux capture-pane -J -p)" urls=($(echo "$content" |grep -oE '(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]')) -wwws=($(echo "$content" |grep -oE '(([a-zA-Z](-?[a-zA-Z0-9])*)\.)*[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' |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]{1,5})?(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/')) +wwws=($(echo "$content" |grep -oE 'www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' |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]{1,5})?(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/')) merge() { for item in "$@" ; do -- cgit v1.2.3