Required expertise on Regex

Hello Community,

I need little expertise on extracting string value using regex.

Total Overpayment $27165.04 Segments tagged/OP ID/amount of overpayment: “04 72750668 5399.96 05 72750669 6291.83 07 72750672 72.75 10 72750678 8370.54 11 72750680 7029.96”

Need to extract bold text only , each value trimmed.

Hi @Sahil_Garg1 ,

For Starters, could you check with the below Regex Expression :

(?<=amount of overpayment:).*?(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)

We would need to access the required values using Groups.

Debug Panel :

Regex.Match(strText,"(?<=amount of overpayment:).*?(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)\s[\d.,]+\s(\d+\s\d+)").Groups(1)


Do note that we only received a Single Sample text, the regex expression could also vary for different formats, do check this with multiple samples and confirm if it works or not. For the given format or pattern, the Regex should be good.

1 Like

Hi @Sahil_Garg1

Try this

Hope this helps!!

mate, if u see third post by @lrtetala , this regex seems very short and good to save, will try both once .



working fine mate currently, also can you help on extracting that dollar value also




working fine

Can you tell how u r making these expression, like knowledge only or some source ? i always get stuck in regex. gives us also some explanations which helps for learning


1 Like


1 Like

thanks a lot @ppr and @lrtetala for your quick response, and cheatsheet.

1 Like

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