How Can I Get A Specific Value In The String

Hello Everyone,

I need a some help.
I have a string value =
114 Haziran 2022 16253 Carisi DROETKER GIDA SANTICAS Fatura Onayı ID_07062022095832

I only need numbers after 2022 from this value. for example in this example I only want to get the value 16253. The area coming after 2022 may change. Is there anyone who can help me with Regex?

Thank you!

Use Matches activity inside uipath activities

Hi @korhansuren

System.Text.RegularExpressions.Regex.Match(InputString,"(?<=\d{4}\s)\d+").Tostring

image

Regards
Gokul

Hi,

Does 2022 always exists? if so, the following will work.

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

Regards,

Hello @korhansuren ,

You can use the below regex :
(?<=\d\s)\d+

image

Regards,
Rohith

Thank you everyone :slight_smile: All options are working.

Hi @korhansuren,

kindly use below

stGetValue = stValue.Substring(stValue.IndexOf("2022 “)+5).Split(” ".ToArray)(0)

thanks,
Rajkumar

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