I am having a bit of trouble parsing the output of \'ipconfig /all\' using a regex. Currently I am using RegexBuddy for testing, but I want to use the regex in C#.NET.
M
Why use regex? Your input is in simple key-value format. Use something along the lines of
foreach (var line in lines)
{
var index = line.IndexOf (':') ;
if (index <= 0) continue ; // skip empty lines
var key = line.Substring (0, index).TrimEnd (' ', '.') ;
var value = line.Substring (index + 1).Replace ("(Preferred)", "").Trim () ;
}