Remove URL from lines but keeps the text
-
Hi Folks
My company antispam system insert a URL in each attach files received by email and cause a discomfort to read the content. How can I solve my discomfort to removing the URL inserted by the antispam, but keeping the rest of the text?
See below some lines of the issue.
Network Next Hop Metric LocPrf Weight Path*> https://protect-eu.mimecast.com/s/tIwRCoY3kuB8G8zGs2IZH5?domain=1.1.0.0 https://protect-eu.mimecast.com/s/-sM8CO7mzS0wXwKXukLavD3?domain=200.182.239.29 0 4230 65450 ?
*> https://protect-eu.mimecast.com/s/n6lRC48APFm6W61WSOkghP9?domain=10.55.0.0 https://protect-eu.mimecast.com/s/-sM8CO7mzS0wXwKXukLavD3?domain=200.182.239.29 0 4230 65450 63814 65500 ?
*> https://protect-eu.mimecast.com/s/6ynJCqjgmTzRrR5rFYtemb?domain=10.55.3.176 https://protect-eu.mimecast.com/s/-sM8CO7mzS0wXwKXukLavD3?domain=200.182.239.29 0 4230 65450 ?
*> https://protect-eu.mimecast.com/s/wjI3Cr0jns16j6vjf67Yt7?domain=10.55.3.208 https://protect-eu.mimecast.com/s/-sM8CO7mzS0wXwKXukLavD3?domain=200.182.239.29 0 4230 65450 ? -
To get rid of http/https URLs in any block of text,
FIND =https?://\S*
REPLACE = blank/empty
SEARCH MODE = regular expression -
@PeterJones said in Remove URL from lines but keeps the text:
https?://\S*
Your suggest worked, but I need to fix a little detail on the expression.
I need to remove the URL until the equal sign and let rest of the text, how can I do that?
-
Heelo, @thiago-morais,
Two questions :
-
Are all the
URLlines in a single line or may be split into several lines ? -
Your
URLlines contain two=signs… What is the exact part to delete ? From beginning to the first or to the second=?
Best Regards,
guy038
-
-
Hello @guy038
As you can see in the line, there are two URL, I need to remove the both and keep the rest of the text after the equal sign.
Current:
*> https://protect-eu.mimecast.com/s/tIwRCoY3kuB8G8zGs2IZH5?domain=1.1.0.0 https://protect-eu.mimecast.com/s/-sM8CO7mzS0wXwKXukLavD3?domain=200.182.239.29 0 4230 65450 ?How should be:
*> 1.1.0.0 200.182.239.29 0 4230 65450 ? -
Hi, @@thiago-morais, @peterjones and All,
Then, two regex solutions are possible :
-
If each
URLline belong to a single line :-
SEARCH
(?-s)https?://.+?= -
REPLACE
Leave EMPTY
-
-
If some
URLline(s) may be split into several ones :-
SEARCH
https?://\S+?= -
REPLACE
Leave EMPTY
-
BR
guy038
-
-
@guy038 said in Remove URL from lines but keeps the text:
(?-s)https?://.+?=
It’s worked
Thanks @guy038
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login