I have a sting output that I want to split somehow. Have tried a few regex expressions but i have early used regex before so no luck. Any idea how to do this the best way?
the string lock like this ALARM,A:341N572964E012045499 A12002172140U AlarmButton R:5 B:4 G:F;
I want this to be splitted so it looks something like this
One more question. $match(payload, /(.),(.)(N.)(E.)(A.) (A.)/).groups works fine. But if I want to remove N and E in the result can I do something like $match(payload, /(.),(.)(N.-1)(E.-1)(A.) (A.)/).groups have tried o lot of combinations but can not get the formatting right. If it works to do something like that?
When working with regex, the regex101 website is a powerful tool to see if you’ve configured it correctly. It supports multiple languages’ flavour of regex, so make sure to set it to JavaScript first. On top of that it has a reference included for all functionality.
Here’s Julian’s last regex, and I think it would work well: https://regex101.com/r/TjwEID/1/