Remove outlook footer

Hi How can I remove all of this after Email Legal Notice:
Please help

This does not work for http:
First I used
image

Then this:
image

You can use this regex with string manipulation

System.Text.RegularExpressions.Regex.Replace(text, “(?<=Email Legal Notice:).*”, “”).Trim().Split(“{”)(0)

in assign activity also replace the text variable with your string variable

If this is needful then mark it as SOLUTION

Happy Automation

Hi thank you, I get this error below:

Don’t copy and paste type it because it is showing that it is an expression but i gave you string and due to this you’re getting error of cannot convert string to char


like this

Typed like that but it’s still giving me the same thing

This is the input string:

Email Legal Notice: https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fwww.buddycentral.co.za%2fwp%2dcontent%2fuploads%2f2024%2f02%2fBuddyCentral%5fE%2dmail%5fLegal%5fNotice%5f.pdf&umid=4bb58b03-312d-4878-888b-c010b269adac&auth=bb0b05c0de672af05f0a2934abd6ba885c98293e-7f7e4547949900f4079761b6c06e318ec6a1db0b <https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2furl.za.m.mimecastprotect.com%2fs%2fMZj%5fCmwXxpiEXOyOHGf5sR8MkE%3fdomain%3dbuddycentral.co.za&umid=5f3fe603-2eae-4f02-b2f1-76311c8495b0&auth=1f89a74ea346bbedd46b2a8679b83c8a85fffaac-8f5ac398ded701316d8b760d2d7b955610fc5178> \r\n\r\nPowered By Nimbis <https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2furl.za.m.mimecastprotect.com%2fs%2fd8OuCnZJyqcMw898CJh6sJ6c8Y%3fdomain%3dnimbis.co.za&umid=5f3fe603-2eae-4f02-b2f1-76311c8495b0&auth=1f89a74ea346bbedd46b2a8679b83c8a85fffaac-a1f771488a9dd8d0bef9c4c59de01bd4651d9a2c> . The Fast, Easy and Reliable Insurance Administration System\r\nPlease do not alter the subject of this email. It is used to track the mail. \r\n[.AXES.9870FA4BDA.] \r\nThis message has been sent as a part of discussion between the sender and the addressee whose name is specified above. The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future. Thank you for your cooperation and understanding. No person related to the group of companies has the authority to conclude any binding contract without an explicit written consent by the relevant board of directors either by resolution or otherwise. In this vein, if any contractual relationship has been entered to in writing, the email cannot modify the written agreement. If there is no contractual relationship, this email cannot be seen to allow for a contractual relationship to arise. All contractual relationships, responsibilities and rights will only be established after a written agreement, where the signatory has been approved by resolution of the board of directors of that company. No person has the right to contract orally or in writing without following the appropriate procedures, which include the obtaining of board approvals.

Can you send me the text by copying it so that i can test ? also your Emalbody_reg variable datatype should be string

New Text Document.txt (1.8 KB)

Just confirming you have to remove the selected part ?

Yes, if possible it should be everything after the : Email Legal Notice.

Up until..: board approval

System.Text.RegularExpressions.Regex.Replace(text, “(?i)(?<=Email Legal Notice:)[\s\S]*”, “”).Trim().Split(“Email Legal Notice”)(0)

try this but it removes Email Legal Notice also

Yes it has to remove that : Email Legal Notice as well..
Thank you let me try

Yes if it works then Mark it as SOLUTION

Happy Automation

Nope: tried :frowning:

May i know what is your variable datatype?

See this i tried it to

image

It’s a string
image

the variable in which you are saving it is of which type ?

Try deleting the variable and recreating it also if the issue is same then try
text.split(“Email Legal Notice”)(0)

and save it into a string variable

Hi @Anelisa_Bolosha1

Try this :slight_smile:

Extract text after “Email Legal Notice:” up to “board approvals” (excluding):

Regex.Match(input, "(?<=Email Legal Notice:)(.*?)(?=board approvals)", RegexOptions.Singleline Or RegexOptions.IgnoreCase).Value.Trim

Include “board approvals”:

Regex.Match(input, "(?<=Email Legal Notice:)(.*?board approvals)", RegexOptions.Singleline Or RegexOptions.IgnoreCase).Value.Trim

Happy Automation

Hi so from the original input text:

I want to remove everything from : 'Email Legal Notice ’ down should be gone.

When I checked your solution in outputs exactly what I want to remove: :slight_smile: