htmanning has asked for the wisdom of the Perl Monks concerning the following question:
I'm building a newsletter and trying to strip URLs from a field because Google recognizes it as an attachment, and other Mail clients present it as a link. I'm currently doing this which isn't working:
$description =~ s/<(?:[^>'"]*|(['"]).*?\1)*>//gs; $shortdesc = substr ($description, 0, 270) . "..."; print "$shortdesc";
I'd like to recodnize the entire link and just not print it but I'm not having much luck. I'm trying to strip any URL, but here's one that doesn't work:
https://drive.google.com/file/d/1ZhXQYI-4fgx5hredv7Z0Tl2sszvN92oV/view +?usp=sharing...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Stripping links from field
by GrandFather (Saint) on Oct 24, 2022 at 22:49 UTC | |
by htmanning (Friar) on Oct 25, 2022 at 00:07 UTC | |
|
Re: Stripping links from field
by haukex (Archbishop) on Oct 25, 2022 at 06:35 UTC | |
|
Re: Stripping links from field
by Your Mother (Archbishop) on Oct 25, 2022 at 10:50 UTC | |
|
Re: Stripping links from field
by choroba (Cardinal) on Oct 24, 2022 at 21:39 UTC | |
by htmanning (Friar) on Oct 24, 2022 at 22:21 UTC | |
by choroba (Cardinal) on Oct 24, 2022 at 22:35 UTC | |
by htmanning (Friar) on Oct 24, 2022 at 22:45 UTC |