Find all Z coordinates and replace with nothing ([ ][Z]([^ |\n])*) Delete blank G00 commands replace with \n (\n[G][0][0]\n) \n