Extract matches

Hello, i Have XML File that I Read into string. I need To extract two results that are between and . So result should be 1588.48 and 40824.17.

4 1588.48 33 40824.17

Use Deserialize XML activity to get it into a proper XML object then you can reference the XML properties to get the values out.

@tomaz Do you want to get through regex?

Yes, I would be veary happy with regex expresion

@tomaz

(\d+.\d+)

This is example file:

TxsSummry
TtlCdtNtries
NbOfNtries>4</NbOfNtries
Sum>1588.48</Sum
/TtlCdtNtries
TtlDbtNtries
NbOfNtries>33</NbOfNtries
Sum>40824.17</Sum
/TtlDbtNtries
/TxsSummry

1 Like

@tomaz
Try this one

Hi @tomaz

If you trying to extract both the values using single regex go with the below expression:

[\d]+\.+[\d]+


Shared the workflow for reference
Sequence1.xaml (10.8 KB)

Hope it helps!!
Regards,

Hi @tomaz

You can use the below regex expressions which will give your required output.
For extracting 4 1588.48 33 40824.17

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=\>)\d+\.*\d*(?=\<))”)

image

For extracting only 1588.48 40824.17

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=\>)\d+\.\d*(?=\<))”)

image

Hope it helps!!

Hi @tomaz

Try the below regex expression

\d+\.\d*

Hope it works !!

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