Regex to extract the temperature

Temperature.txt (9.8 KB)

Hi i have created a flow to extract the InnerHTML. So now i need to extract the temperature (BOLD) base on the location .For example. I thought of using regex. but nit sure of the pattern.

class=‘list-unstyled’>

  • Location: Changi
  • Heat stress level: Low
  • WBGT (℃): 29.0
  • Air temperature: 29.5℃
  • " data-original-title=“” title=“” onclick=“showByClickSpan(‘S124’)” style=“display: block; top: 167.171px; left: 707.501px;” class=“sgr points icon shadow low” data-UiPath_custom_id_23_10_66_33458=“13”><span id=“S125” data-toggle=“popover” data-placement=“top” data-trigger=“hover” data-content="
    • Location: Woodlands Stadium
    • Heat stress level: Low
    • WBGT (℃): 29.7
    • thank you

    1 Like

    @faridmd

    Hope this helps you

    Welcome @faridmd to the UiPath Community Forums :partying_face:

    Give these patterns a try:
    Location
    Heat stess level
    WBGT

    Cheers

    Steve

    Hi,

    Can you try the following sample?

    mc = System.Text.RegularExpressions.Regex.Matches(strText,"Location:(\s*\<[^<]+\>)+(?<LOCATION>[^<]+)(\s*\<[^<]+\>)+Heat stress level:(\s*\<[^>]+\>)+(?<HSL>[^<]+)(\s*\<[^>]+\>)+WBGT\s*\([^)]+\): (?<WBGT>[\d.,]+)")
    

    Sample
    Sample20231004-3L.zip (4.5 KB)

    Regards,

    1 Like

    Hello Yoichi,

    Awesome. It works wonderfully. Thank you for your help. Theres more to learn for me… cheers.

    1 Like

    This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.