mirror of
https://github.com/BKLronin/touchCNC.git
synced 2024-11-10 03:04:01 +01:00
13 lines
307 B
Python
13 lines
307 B
Python
|
import re
|
||
|
|
||
|
|
||
|
line = "<Idle|WPos:69.000,40.000,-20.000|Bf:15,128|FS:0,0>"
|
||
|
pattern = r"<[^|]*\|WPos:([^,]*),([^,]*),([^|]*)\|"
|
||
|
m = re.match(pattern, line)
|
||
|
|
||
|
if m:
|
||
|
print("Group 1 (X):", m.group(1))
|
||
|
print("Group 2 (Y):", m.group(2))
|
||
|
print("Group 3 (Z):", m.group(3))
|
||
|
else:
|
||
|
print("No match found.")
|