using System.Text.RegularExpressions;
public static void Main()
String str = "ReturnCode=0 CODE=[ZDesigner GX420t], [GK420t], [ZDesigner Z4Mplus 203DPI], [CT420T] DESCRIPTION=Yes, Yes, Yes, Yes STATUS_VALUE= REWORK_REVISION=0 DATA10=4 FAC_ID=ICTEST";
if(!str.Substring(0, 12).Equals("ReturnCode=0"))
String sp_data = str.Substring(13);
Regex regex = new Regex(@"([A-Z_0-9])+\=");
Regex codeRegex = new Regex(@"(\[.*\])");
Regex descRegex = new Regex(@"([A-Za-z])\,/s");
Match match = regex.Match(sp_data);
String key = match.Groups[0].ToString();
match = match.NextMatch();
String[] keyArray = keys.Split('=');
String[] valueArray = new String[keyArray.Length];
for(int i = 0; i < keyArray.Length; i++) {
int start = sp_data.IndexOf(keyArray[i]) + keyArray[i].ToString().Length + 1;
if(i < keyArray.Length - 1) {
int end = sp_data.IndexOf(keyArray[i + 1]);
valueArray[i] = sp_data.Substring(start, end - start);
valueArray[i] = sp_data.Substring(start);
MatchCollection codes = codeRegex.Matches(valueArray[0]);
MatchCollection descs = descRegex.Matches(valueArray[1]);
for(int i = 0; i < codes.Count; i++)