hye, I got this error "An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in System.dll" while doing this split code. the error occur at code textBox1.Text= mc[0].Groups[1].Value;
var desiredText = File.ReadLines(location).ElementAt(i);
string s = desiredText.ToString();
//textBox3.Text = s;
Regex r = new Regex(@"[(.+?)]");
MatchCollection mc = r.Matches(s);
textBox1.Text= mc[0].Groups[1].Value;
textBox2.Text= mc[1].Groups[1].Value;
textBox3.Text = mc[2].Groups[1].Value;
where did I do wrong? the textfile that I used have this data
[1] [apple] [market]
[2][toy]asdv[shop]sdvdsrdt