Ciao,
puoi usare una list<Point> e via via che fai il Match con regex vai ad aggiungere un nuovo Point a quella lista, che abbia le coordinate che arrivano appunto dal Match.
Un codice di questo tipo:
...
List<Point> pt = new List<Point>();
Regex coord = new Regex(@"X(?<CoordX>\d+)Y(?<CoordY>\d+)");
MatchCollection mc = coord.Matches(textBox1.Text);
foreach (Match m in mc)
{
int x = int.Parse(m.Groups["CoordX"].Value);
int y = int.Parse(m.Groups["CoordY"].Value);
pt.Add(new Point(x,y));
}
g.DrawLines(myPen, pt.ToArray());
...
Ciao.
Matteo Raumer
[MCAD .net, MVP Visual C#]
http://blogs.dotnethell.it/freeteo