Skip to content

Commit

Permalink
Improve extract regex
Browse files Browse the repository at this point in the history
  • Loading branch information
wfxr committed Apr 14, 2018
1 parent 557b9c9 commit a302a19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fzf-url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a302a19

Please sign in to comment.