fork download
  1. import re
  2. p = re.compile(r'\s*\([^()]*\)[ \t]*$', re.MULTILINE)
  3. s = "%\nO1000\nT1 M6\nG0 G90 G40 G21 G17 G94 G80\nG54 X-75 Y-25 S500 M3 (Start Point)\nG43 Z100 H1\nZ5\nG1 Z-20 F100\nX-50 M8 (Position 1)\nY0 (Position 2)\nX0 Y50 (Position 3)\nX50 Y0 (Position 4)\nX0 Y-50 (Position 5)\nX-50 Y0 (Position 6)\nY25 (Position 7)\nX-75 (Position 8)\nG0 Z100\nM30\n%"
  4. result = p.sub("", s)
  5. print(result)
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
%
O1000
T1 M6
G0 G90 G40 G21 G17 G94 G80
G54 X-75 Y-25 S500 M3
G43 Z100 H1
Z5
G1 Z-20 F100
X-50 M8
Y0
X0 Y50
X50 Y0
X0 Y-50
X-50 Y0
Y25
X-75
G0 Z100
M30
%