Regex help 11.26.22

Hello, the sample text:

“Transmission Network Charge 188.784 kW @ $674.68 2022.”

there can be anything after 674.68, not necessarily 2022 (and there will be other text after 2022 as well)

I need to capture 674.68
the existing expression
(?<=Transmission Network Charge)(?:.* $?)([\d,.]+)
captures 2022 instead. can someone please help?

Hi,

How about the following?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=Transmission Network Charge.*?\$)[\d,.]+").Value

Regards,

Hi @lynnsong986

Try this


(?<=Transmission Network Charge)(?:.*)(\$\d+.\d+)

Happy Automation

Cheers

thanks both, this works perfectly!
Lynn

1 Like

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