aboutsummaryrefslogtreecommitdiff
path: root/urlgrep
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-09-29 11:06:20 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-09-29 11:06:20 +0200
commit98fcba37eee4e6d825aa1674529301e7c77649a2 (patch)
treea1c541c7a475e5921b2daeee1da36eacfb7a40a8 /urlgrep
parent927e35f80483f55d91f2e9a3f84b81768fdf73e1 (diff)
parenta04beb5ea91ceac2d6a06f344527ed4d1c8e6fd0 (diff)
downloadscripts-98fcba37eee4e6d825aa1674529301e7c77649a2.tar.gz
scripts-98fcba37eee4e6d825aa1674529301e7c77649a2.zip
Merge branch 'master' of tronto.net:scripts
Diffstat (limited to 'urlgrep')
-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