How to use regex?

I want to read number after text Complain_ and before _

image

Example : Filename
Complain_229_062021_ERE_Report.pdf , Complain_896_062021_ERE_Report_887.pdf

I want to output round1 show 229 , round 2 show 896

Please guide me about it.

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=_)\d+").Value

Regards,

2 Likes

@Maria99 - As an alternate , you can use string manipulation to extract the numbers as shown below…

image

1 Like

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