How to get value using Regex in the statement

I have the above text in a text file, I need to extract the value which is after Total Rec. in this case it is 234 can anybody suggest a regex expression ?

please share string by copy

Hi @Ishan_Shelke

(?<=Total Rec\.)([\s\S]*)(?=Total Disc\.)

This regex could work for you.
Later just use a Trim(" :".ToCharArray) function to remove the blank spaces.


1 Like

Hi @Ishan_Shelke

Try the following below expression:


Hope it helps!!

Hey, This Regex may work for you
It takes any string/number which comes after Total Rec and before Total Disc

(?<=Total Rec.\s+)([\d.]+)(?=\s+Total Disc)


Hi @Ishan_Shelke

Please use below regex expression

Hoe it works !!

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