I’m glad to hear it worked!
I have a question about your regex expression. However, before I get to it, I noticed your data is in JSON format. Perhaps you should consider using JSONPATH Transformation instead of REGEX. JSONPATH is far more legible than regex expressions. For example, $.target would get the target value. Easy as that!
My question is about your use of 9 capture groups in your regular expression. Why?
Here’s your regex expression:
(.{28})(actual)(.{3})(\\d*.\\d*)(.{3})(target)(.{3})(\\d*.\\d*)(.{1})
It contains 9 capture groups but you only use 4 of them (second, fourth, sixth, and eighth; $2, $4, $6, $8).
The following expression means match 28 characters whatever they may be
.{28}
When you surround it in parentheses, it becomes a capture group.
(.{28})
It becomes the first capture group but you never use $1 so why make it a capture group?
Here’s another observation. You’re using this expression in a capture group to get a floating point value.
(\d*.\d*)
However the period (.) in that expression means to match any character not just a literal period (decimal point in a floating point value). The expression will match 43.2, 432, and even 43Z3. If that’s what you want then OK. If it’s not, then you have to escape the period in order to make the expression match a literal period.
(\d*\.\d*)
Or for OpenHAB’s REGEX, it would look like this:
(\\d*\\.\\d*)
In addition, the asterisk means zero or more. So \d* means zero or more digits. If you want it to match one or more digits then use a plus sign instead of an asterisk:
(\d+\.\d+)
If the labels, actual and target, never change then you only need to get the floating point values with just 2 capture groups.
.+actual.+ (\d+.\d+).+target.+ (\d+\.\d+)}
For OpenHAB’s REGEX, it will look like this. You don’t need the global “g” option because the expression’s first match will contain both values.
s/.+actual.+ (\\d+\\.\\d+).+target.+ (\\d+\\.\\d+)}/actual-$1 target-$2/