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

Generated with cgit - Back to sebastiano.tronto.net