Regex question 02.14.23

Hello, I need to extract the last amount (1,048.09) from the below test string.

37.94 KW x $2.6461 19.43
Global Adjustment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $ 1,048.09

15822.83 KWh x $0.059619993 943.36

the expression (?<=Global Adjustment)(.\s)+$\s([\d.,]+$) works in regex101 but not studio. can someone please help?

the text provided as done has the risk, that a in regex101 working pattern maybe will fail in UiPath. Providing samples as text files is more reliable.

However let us try:


referring to group1:
grafik

Kindly note that a dollar sign will always be escaped with backslash, otherwise we tell the pattern end of line
we made the pattern ungreedy with +? and challenged it with more sample dollar amounts at the end to check if it will be catched or not

Pattern:
(?<=Global Adjustment)(?:[\s\S]+?\$ ?)([\d.,]+)

thank you so much for your kind help again! so much appreciated!!

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