[Solved] Regular Expression to remove leading and trailing Angle Brackets


Why do you need to use Regex for this?

You can simply do this:

string email = "<[email protected]>";
email = email.TrimStart('<').TrimEnd('>');

Of course if you really need to be sure there’s no spaces, or that there might be multiple spaces:

string email = "<[email protected]>";
email = email.Trim().TrimStart('<').TrimEnd('>');

solved Regular Expression to remove leading and trailing Angle Brackets