summaryrefslogtreecommitdiff
path: root/scripts/urlgrep
blob: 49afac6e40128bdf7552b7d5adbeb46e49a38459 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh

# Find all URLs in stdin, print them newline-separated to stdout

protocols='http|https|ftp|sftp|gemini|mailto'
valid_chars="][a-zA-Z0-9_~/?#@!$&'()*+=.,;:-"
regex="(($protocols):|www\.)[$valid_chars]+"

egrep -o "$regex"

Generated with cgit - Back to sebastiano.tronto.net