Regex regex = new Regex(@"X(-?\d+)\.(\d+)Y(-?\d+)\.(\d+).*?G00Z(-?\d+)\.(\d+).*?G00X(-?\d+)\.(\d+)Y(-?\d+)\.(\d+).*?G01Z(-?\d+)\.(\d+).*?G02X(-?\d+)\.(\d+)Y(-?\d+)\.(\d+)I(-?\d+)\.(\d+)J(-?\d+)\.(\d+)", RegexOptions.Singleline);
textBox1.Text = regex.Replace(textBox1.Text, "G5 X$1,$2 Y$3,$4\nG0 Z$5,$6\nG0 X$7,$8 Y$9,$10\nG1 Z$11,$12\nG2 X$13,$14 Y$15,$16 I$17,$18 J$19,$20");
SELECT `id`
FROM `cms3_objects` AS `o`
JOIN `cms3_object_content` AS `t1` ON `t1`.`obj_id` = `o`.`id`
AND `t1`.`field_id` = '911' AND `t1`.`rel_val`='283367'
JOIN `cms3_object_content` AS `t2` ON `t2`.`obj_id` = `o`.`id`
AND `t2`.`field_id` = '912' AND `t2`.`rel_val`='800'
JOIN `cms3_object_content` AS `t3` ON `t3`.`obj_id` = `o`.`id`
AND `t3`.`field_id` = '913' AND `t3`.`rel_val`='66756'