aboutsummaryrefslogtreecommitdiff
path: root/urlgrep
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xurlgrep9
1 files changed, 7 insertions, 2 deletions
diff --git a/urlgrep b/urlgrep
index ba81765..665f19a 100755
--- a/urlgrep
+++ b/urlgrep
@@ -2,7 +2,12 @@
2 2
3# Find all url in stdin, print them newline-separated to stdout 3# Find all url in stdin, print them newline-separated to stdout
4 4
5reg='(((http|https|ftp)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]' 5# Old regex (PCRE), kept it for later review:
6# reg='(((http|https|ftp)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]'
7# grep -Po "$reg"
6 8
7grep -Po "$reg" 9protocols='http|https|ftp|gemini|mailto'
10valid_chars="][a-zA-Z0-9_~/?#@!$&'()*+=.,;:-"
11regex="(($protocols):|www\.)[$valid_chars]+"
8 12
13egrep -o "$regex"

Generated with cgit - Back to sebastiano.tronto.net