I cannot find out if this is possible, and if I want to push lambda too far. I do not like the double regex (the Class.Column is not mine). I have this simple select function :
(ColumNames is a List)
string reg = "(.*):(.*)";
Class.Column[] Columns = (Class.Column[])this.ColumnNames
.Select(x =>
new Class.Column() {
Param1 = Regex.Match(x, reg).Groups[1].ToString(),
Param2 = Regex.Match(x, reg).Groups[2].ToString()
}
);
Is there a way to set the regex output as z, then param1 = z1.Groups[1].ToString()?
x.Split(':')