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


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 ^(?:[^,]+,){5}\K([^,]*)

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

Any help much appreciated


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.




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.