Serial device regex
Hello,
I'm toying around with the Basic Serial device and having fun. Sending data is working without a hitch but reading is another matter.
When I'm trying to read data using regex, then instead of saving the regex capture group as the value, the entire data string or nothing, is stored as the Value.
For instance, this is what is coming in to the Serial port: 1;3;1;0;0;21.3
I'm interested in the last floating point number (21.3)
I have created 2 devices for reading data. One is a Double, the other is a String. Both are using this regex: 1;3;1;0;0;([\d+.\d+]*)
This is what the Double gets as a Value: 0
This is what the String gets as a Value: 1;3;1;0;0;21.3
Looks like I was going about it the wrong way. I thought that we need to define a regex match and then a capture group inside it to get what we need. However, in reality the entire Regex we write is essentially a capture group. So when using helpers like this: https://regex101.com/ you need make sure that the "Full match" gets you the data you need, and ignore the individual capture groups.