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?


How about the following?

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


Hi @lynnsong986

Try this

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

Happy Automation


thanks both, this works perfectly!

1 Like

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