If someone could help me to match the patterns in this string, I would appreciate it.
I was trying to do like “1 section at a time” for the match, but the parts are being defined for the wrong variables…
local msg = "Rustfeather the bird (1.25m/1.27m 99.13%) is at 65.13 77.81, and has been engaged!"
local name, health, i0, x, i1, y = msg:match("([%w+%s]+)%s%(([0-9%.]+%w)%p([0-9%.]+%w)%s([0-9%.]+%w)")
Output:
CHANNEL_MSG: Rustfeather the bird 1.25m 99.13 nil 1.27m nil
What I am looking for in a final match would be:
Name: Rustfeather the bird
disregard: 1.25m/1.27m
Health: 99.13
Position X: 65.13
Position Y: 77.81
Thank you
Mike