How to extract string value using regex in Uipath

Hi team,

I have one text like hello,world (1234567)

From above text i want only hello, world using regex in UiPath.

Kindly suggest

Hi @Baby123

Use this regex

yourInputText= "hello,world (1234567)"
Output= System.Text.RegularExpressions.Regex.Match(yourInputText, "([a-zA-Z\s,]+)").Value

Output is of DataType System.String

Regards

Hi @Baby123

Use below expression
Str_Var= “hello,world (1234567)”

System.Text.RegularExpressions.Regex.Match(Str_Var, “\b([a-zA-Z,]+)\b”).Value

Hope it will helps you :slight_smile:
Cheers!!

Hi,

Can you share condition of your requirement in details?

If you want to extract text before (, the following will work.

System.Text.RegularExpressions.Regex.Match(strData,".*(?=\()").Value

Regards,

@Baby123

Please share proper condition you need…

If you need before ( then split also will do the job…you dont need regex at all

Str.Split("("c).First

Cheers