Problem with http binding, REGEX syntax

Hello everybody,

I’ve been trying to read data from a device with http binding for a while.
My item for collecting all data looks like this:
String Test_Value1 "Performance [% s]" {http = "<[http://xxx.xxx.xxx.xxx/test.htm:60000:REGEX ((. *))]"}

I get the entire content back.
Now I only want the value 160 from the line

<div id = "pos20"> 160 </div>
read.
I just don’t get the syntax for the REGEX correctly.
There are always errors in the single quotes of “pos20”.

Can someone please help me there?
Thanks a lot!

I’m horrible at REGEX but maybe this post can help you.

or

Thank you!
The REGEX tester from regex101.com was a great help for me.

1 Like

I was hoping you would find the post useful.:+1: I keep them bookmarked just for the REGEX users.:wink:

Hi there,
I was able to solve the problem.
{http = "<[http://xxx.xxx.xxx.xxx/test.htm:60000:REGEX (. *? <div id = .pos20.> (. *?) </div> (. *) )] "}
The value has a fixed number of characters.
The missing characters are also filled in with &nbsp; and displayed.
This is a space as a wildcard.
e.g .:
-&nbsp;0,5
&nbsp;&nbsp;0,5
&nbsp;1,5

Can I use a replace function to remove the &nbsp; characters?

Thanks a lot!