diff options
author | Wenxuan <wenxuangm@gmail.com> | 2018-04-14 11:41:28 +0800 |
---|---|---|
committer | Wenxuan <wenxuangm@gmail.com> | 2018-04-14 11:41:28 +0800 |
commit | a302a198fd5414caa5c7ce438197200f7b37c66c (patch) | |
tree | 362c83bf8765c164d7fe3c8ac75989bdf94e845c | |
parent | 557b9c95c6f24b2060b2b8dc338dea05c3e59528 (diff) | |
download | fork-tmux-fzf-url-a302a198fd5414caa5c7ce438197200f7b37c66c.tar.gz fork-tmux-fzf-url-a302a198fd5414caa5c7ce438197200f7b37c66c.tar.bz2 fork-tmux-fzf-url-a302a198fd5414caa5c7ce438197200f7b37c66c.zip |
Improve extract regex
-rwxr-xr-x | fzf-url.sh | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -16,9 +16,9 @@ elif hash open &>/dev/null; then 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/')) +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/')) merge() { for item in "$@" ; do |