string str = "X=189 Y=168";
Match match = System.Text.RegularExpressions.Regex.Match(str, "X=([0-9]+) Y=([0-9]+)");
int x = int.Parse(match.Groups[1].Value);
int y = int.Parse(match.Groups[2].Value);
MouseEventArgs e = new MouseEventArgs(MouseButtons.Left, 1, x, y, 0);