diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-08-20 14:05:08 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-08-20 14:05:08 +0200 |
| commit | a04beb5ea91ceac2d6a06f344527ed4d1c8e6fd0 (patch) | |
| tree | 63dbaa20ebcd81b5add3699794daed0bede2aa0e /urlgrep | |
| parent | ff99a09b4721f41da8a084b9717a05ba3b785067 (diff) | |
| download | scripts-a04beb5ea91ceac2d6a06f344527ed4d1c8e6fd0.tar.gz scripts-a04beb5ea91ceac2d6a06f344527ed4d1c8e6fd0.zip | |
Removed useless comment, added ftp to urlgrep
Diffstat (limited to '')
| -rwxr-xr-x | urlgrep | 8 |
1 files changed, 2 insertions, 6 deletions
| @@ -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: | 5 | protocols='http|https|ftp|sftp|gemini|mailto' |
| 6 | # reg='(((http|https|ftp)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]' | ||
| 7 | # grep -Po "$reg" | ||
| 8 | |||
| 9 | protocols='http|https|ftp|gemini|mailto' | ||
| 10 | valid_chars="][a-zA-Z0-9_~/?#@!$&'()*+=.,;:-" | 6 | valid_chars="][a-zA-Z0-9_~/?#@!$&'()*+=.,;:-" |
| 11 | regex="(($protocols):|www\.)[$valid_chars]+" | 7 | regex="(($protocols):|www\.)[$valid_chars]+" |
| 12 | 8 | ||
