How can I create Regex

D1234501~DATAQUALITY,MANUFACTURING,CHANGESTOBEDONE~DATAITEM~2~964.04

~GRANDTOTAL DATA COMPONENT VALUE (DATA REMOVED 40,101)~40,101.00

DATA INFORMATIONS AND DETAILED DESCRIPTIONS:
PARTDATA

This is the sample txt data, from here I only want to extract “40,101.00” this value, how can i provide regex.
The value inside the bracket " (DATA REMOVED 40,101)" it will varies accordingly.so we cant specify DATA REMOVED 40,101 while providing regex.can anyone please help me to sort it out.

Hi,

If you want to extract numeric value from a line of “GRANDTOTAL DATA COMPONENT VALUE”, the following will work.

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=GRANDTOTAL DATA COMPONENT VALUE.*?)[\d.,]+$",System.Text.RegularExpressions.RegexOptions.Multiline).Value

Regards,

Hello @Chippy_Kolot
Try this regex Expression
(?<=[()]~)[0-9+,.-]+

type or paste code here

System.Text.RegularExpressions.Regex.Match(YourString,“(?<=[()]~)[0-9+,.-]+”).ToString.Trim
image