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
URL
lines in a single line or may be split into several lines ? -
Your
URL
lines 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
URL
line belong to a single line :-
SEARCH
(?-s)https?://.+?=
-
REPLACE
Leave EMPTY
-
-
If some
URL
line(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