using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?<=From:)((?:(?!>).)*)>";
string substitution = @"";
string input = @"From: FirstName LastName <FirstName.MiddleName.LastName@someemail.com>
In-Reply-To: <fc7b93ca4dab.531f4e68@my.bcit.ca>
-------------------------------------------------
From: ""FirstName. MiddleName =?iso-8859-1?b?TWFydO1uZXo=?= LastName""
<somemeail@something.otherthing.es>
Subject: Re: Some Randome Data
In-Reply-To: <42043F8EC804DB48A3C4AF477195328F272CB9@exchange.something.local>
-------------------------------------------------
From: ""FirstName MiddleName LastName"" <LastName@someemail.com>
Subject: Some Randome Subject
-------------------------------------------------
From: ""FirstName. MiddleName =?iso-8859-1?b?TWFydO1uZXo=?= LastName""
<somemeail@something.otherthing.es
>
Subject: Re: Some Randome Data
In-Reply-To: <42043F8EC804DB48A3C4AF477195328F272CB9@exchange.something.local>
-------------------------------------------------
From: ""FirstName. MiddleName =?iso-8859-1?b?TWFydO1uZXo=?= LastName""
<
somemeail@something.otherthing.es
>
Subject: Re: Some Randome Data
In-Reply-To: <42043F8EC804DB48A3C4AF477195328F272CB9@exchange.something.local>";
RegexOptions options = RegexOptions.Singleline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx