Detect all links on body, regex, sed + grep

Here is sample link list:
List links which include %20, %25, %22 in the middle:
grep -E -o "^[fht]+p(s)?:\/\/([a-zA-Z0-9\.\/_:?=&\*()+-]+(%20|%25|%22)?){1,}" test-links.txt
Usage on Windows:
curl -s "https://catonrug.blogspot.com/feeds/posts/default/1455851837304029069?alt=json" | jq -r ".entry|.content|.\"$t\"" | sed "s/http/\nhttp/g;s/ftp:/\nftp:/g;s/\</\n/g" | grep -E -o "^[fht]+p(s)?:\/\/([a-zA-Z0-9\.\/_:?=&\*()+-]+(%20|%25|%22)?){1,}"
curl -s "https://catonrug.blogspot.com/feeds/posts/default/6359409875049177424?alt=json" | jq -r ".entry|.content|.\"$t\"" | sed "s/http/\nhttp/g;s/ftp:/\nftp:/g;s/\</\n/g" | grep -E -o "^[fht]+p(s)?:\/\/([a-zA-Z0-9\.\/_:?=&\*()+-]+(%20|%25|%22)?){1,}"
On Linux:
curl -s "https://catonrug.blogspot.com/feeds/posts/default/1455851837304029069?alt=json" | jq -r '.entry|.content|."$t"' | sed "s/http/\nhttp/g;s/ftp:/\nftp:/g;s/\</\n/g" | grep -E -o "^[fht]+p(s)?:\/\/([a-zA-Z0-9\.\/_:?=&\*()+-]+(%20|%25|%22)?){1,}" | sort | uniq
curl -s "https://catonrug.blogspot.com/feeds/posts/default/6359409875049177424?alt=json" | jq -r '.entry|.content|."$t"' | sed "s/http/\nhttp/g;s/ftp:/\nftp:/g;s/\</\n/g" | grep -E -o "^[fht]+p(s)?:\/\/([a-zA-Z0-9\.\/_:?=&\*()+-]+(%20|%25|%22)?){1,}" | sort | uniq
curl -s "https://catonrug.blogspot.com/feeds/posts/default/6120999660201884210?alt=json" | jq -r '.entry|.content|."$t"' | sed "s/http/\nhttp/g;s/ftp:/\nftp:/g;s/\</\n/g" | grep -E -o "^[fht]+p(s)?:\/\/([a-zA-Z0-9\.\/_:?=&\*()+-]+(%20|%25|%22)?){1,}" | sort | uniq

No comments: