How to provide regex

~DATA UPDATION (140 HOURS)~-~120690.00

~TOTAL AMOUNT~56478.80
The output which i need to extract is 120690
I tried to provide regex as (?<=DATA UPDATION(140 HOURS)).* This is static it will comes as 140 hours or 2 hours.

Hi @Chippy_Kolot

How about this expression?

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=DATA UPDATION\s.)(\d+.\D+)(\d.+)").Groups(2)



1 Like

you can

System.Text.RegularExpressions.Regex.Match(YourString,“(?<=DATA UPDATION\s.)(\d+.\D+)(\d.+)”).Groups(2)

this regex provided by @Gokul001

after that output.split("."c).toarray(0).tostring

you can use like that

Kindly try this

System.Text.RegularExpressions.Regex.Match(System.Text.RegularExpressions.Regex.Match(YourString,"(?<=~DATA UPDATION)").Tostring.Trim,"(?<=~)[\d.]+").ToString.Trim

Also, try this





Hi @Chippy_Kolot ,

The Pattern of the String is similar to a previous post created by you :

You could take the Solution from one of the posts provided there which best suits the pattern, For your current case, you would just have to replace the Key (CLASS TIME) with your current Key (DATA UPDATION)

(?<=DATA UPDATION.*?~)[\d.,]+

Also note that your previous post was not marked as Solved.

Hello @Chippy_Kolot - Minor change to your expression