I’m trying to extract a number from the third row of a command issued by a raspberry
iostat -c
Linux 4.1.18-v7+ (raspberrypi) 16/07/16 armv7l(4 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
10.50 0.00 0.44 0.18 0.00 88.89
I’m absolutely not a REGEX expert but I was expecting the following line
str=transform(“REGEX”,(.*)",command)
to place in the str string only the first line ( the dot matches any character except newline) but it actually gives all the lines.
I was thinking that
str=transform(“REGEX”(?:.){3},(.)",command)
would have given the 4th line, but it does not work.
Is this a limitation of the implementation of REGEX in openhab?
Should I use a JavaScript transformation rule instead?
Thanks for your help,
LionHe