I have this string
AnyText: "jonathon" <[email protected]>
Desired Output Using Regex
AnyText: <[email protected]>
Omit anything in between !
I am still a rookie at regular expressions. Could anyone out there help me with the matching & replacing expression for the above scenario?
Try this:
string input = "jonathon <[email protected]>";
string output = Regex.Match(input, @"<[^>]+>").Groups[0].Value;
Console.WriteLine(output); //<[email protected]>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With