I'm working on figuring out a good regular expression that would take a value such as:
Transformer Winding Connections (Wye (Star) or Delta)
and would match:
Wye (Star) or Delta
What I have so far is:
string longName = "Transformer Winding Connections (Wye (Star) or Delta)";
// Match everything until first parentheses
Regex nameRegex = new Regex(@"([^(]*)");
Match nameMatch = nameRegex.Match(longName);
// Match everything from first parentheses on
Regex valueRegex = new Regex(@"\(.+\)");
Match valueMatch = valueRegex.Match(longName);
valueMatch is returning:
(Wye (Star) or Delta)
Is there some clever way to only remove the first set of parentheses in C#?