I try to get some Status Values from my Heating. It seems to expose Values only via it’s Web Interface.
I try to use the HTTP Binding and then extract the Values via RegEx. But I don’t really understand how RegEx is working in OpenHab.
I develop the RegEx with regex101.com an Example can be found here: https://regex101.com/r/672uOy/1
As far as I understood OpenHab is using the SingleLine option. Which makes it incredible hard for me to find a condition to stop the Group on the end of the Value.
In the Example I’m searching for the Value in the span with data-id=“22026”. Here the Word “Ausbrand”.
I’m not sure if it could be more than one word or if it could contain letters or anything else.
My first Attempt was this RegEx: /22026.“live”>(.)</span>/gs
But it will not match the contents between this first live and the following span, but anything between the last live and span combination.
I really don’t know how to tighten the RegEx up so it will capture only the first contents between live and span.
My seccond attempt was this RegEx: /22026.“live”>(.)Kesseltemperatur/gs
This greatly reduces unwanted contents in the Match group. But still has to much Content after the Word “Ausbrand”.
I hope I could explain my Problem probably.
I think a look at the link https://regex101.com/r/672uOy/1 can explain my problem best.
Can anyone shed some light on why OpenHab uses the /s option at the end? Or why it seems like this to me?
And how to get just the word Ausbrand in the Example?
Thank you in advance.