Regex to extract nth item from CSV string and save it to a string variable

Hi

I have this string, from which I need to extract the 6th item:

openMessageDetail(0,1,0,2,1234567,123456789,1,user_123456789,0,0,0,0,0,“”,2,“”,“”,0,“Fred FLINTSTONE”)

I tried using this regex I built in regex101.com: ^(?:[^,]+,){5}\K([^,]*)

But UiPath returns nothing when I test it in the regex builder.

Any help much appreciated

Hi,

If we use regex101 for UiPath, it’s better to set C# at flavor as the following image.
And the following pattern will work for your requirement.

(?<=^([^,]+,){5})[^,]*

Regards,

2 Likes

That works @Yoichi .

Thank you for the exceptionally fast help.

All the best

1 Like

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