fork download
  1. import re
  2. texts = ["G1X-10.599Z12", "X9.4Y800", "Y70.190", "X18.3", "X25Z13"]
  3. for s in texts:
  4. print( re.sub(r"X([^A-Z]+)", r"X[\1+#1]", s) )
  5.  
Success #stdin #stdout 0.02s 9668KB
stdin
Standard input is empty
stdout
G1X[-10.599+#1]Z12
X[9.4+#1]Y800
Y70.190
X[18.3+#1]
X[25+#1]Z13