Extract first two numbers after + sign

extract first two numbers after + sign using regex , how to write regex for that , specifically i have the file name "+25 RES021_20231003233424 " , i need to extract only 25 , can someone please help

Hi @JOBIN_JOSE ,

Please try this regex pattern: “(?<=\+)\d+”

Thanks!

Hi,

How about the following?

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

image

regards,

@JOBIN_JOSE

Hi @JOBIN_JOSE

You can try with this expression

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=\+)\d{2}").ToString

image

Hi @JOBIN_JOSE

(?<=\+)\d+

image

Try this

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=\+)[0-9]{2}").value.trim

@JOBIN_JOSE

Hi

Try This
strvalue = System.Text.RegularExpressions.Regex.Match(“+25 RES021_20231003233424”,“(?<=+)\d{2}”).Value

Thank you

Hi @JOBIN_JOSE

Input= "+25 RES021_20231003233424 "
Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=\+)\d+").Value

Hope it helps!!