+3
Under review

RegEx Parsec

Marco Magnani 6 years ago in Devices / Http updated 6 years ago 5

Dear,

I try to use RegEx to collect some value data of my weather station (WS) from an HTML page. Unfortunately, the weather station doesn’t support API or XML, so from Http Device I import with success the WS html page in text and after I use RegEx to parsec it

The problem is that the RegEx implemented in bOS seams don’t manage the Capturing Group (in the picture is the $1) but only the matched string.

What I did was to select a specific part of the html imported page (the highlighted in the picture in green) and after extract the number 51 that is the value that I need to collect and associate to the integer variable in bOS as reported in the piture

Due to the WS uses almost the same html code to provide other sensors values ( e.g. for Outdor temp: <td bgcolor="#EDEFEF"><input name="outTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="26.7" maxlength="8"></td>

I had to select the part of html code that contains the specific value number that I need to collect and use the capturing group to extract from the selected html code part the sensor value, but this regex sentence in bOS it seams doesn’t work

Can you help me to manage this issue or implement in bOS a way to manage the Capturing Group, please?


Marco

Image 1486


Under review

Hello,


are you using c# regex?


Best regards.

Dear,

I m using the RegEx available in your bOS tool! I don’t know what kind of RegEx has been implemented in bOS (and thsi was the first problem when I wrote the query)

What I wrote before is that in the RegEx implemented inside bOS it seems different from the one that you refer in the bOS configurator manual (see my picture extrapolated from your manual): it seems that in bOS you don t manage the capturing group but only the match even do the tool that you refer in the bOS manual manage both!

Can you help me, please?



Marco

Hi,

any news?

I still waiting for the fixing...!


Marco

Hello,


please find the picture below for the regex example and try using = (?<=input name="outTemp".+ value=")(.*)(?=" maxlength) to get correct data.


Best regards.



It works!!! Many tnx...