Using Regex

Hi
Can anyone tell me how to extract “PS_GL_LEGAL_ENTITY_GBL” and I10234 from the below text.
In PS_GL_LEGAL_ENTITY_GBL and rollup rules Target Segment Detail Value = I10234

@Ankita_Biswas … Please check here…

PS_GL_LEGAL_ENTITY_GBL = Regexvariable(0).groups(1).tostring
I10234 = Regexvariable(0).groups(2).tostring

Please check this post on how to work on Group regex and other regex tutorials

2 Likes

@Ankita_Biswas …did you get a chance to try? If yes and if it solves your query please mark my post as solution , that will close this thread.

i will try it but can you please tell me how to assign it to a variable and get the value in the variable.

I will share the sample xaml. In the meantime could you please show us what you have tried so far ?

I have used is match function of uipath and put in the regex . I am not aware how to get the output in a variable.

Hi @Ankita_Biswas

U can try the for each loop with argument type as

System.Text.RegularExpressions.Match

And then loop through each items to get the values

If u had only one value in output of matches activitiy

Then u can use output_var.ElementAt(0).ToString.

Where output_var is the output of matches activitiy

Hope it helps you

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed:

@Ankita_Biswas - Please find the starter help here…Regex_AB.zip (34.4 KB)

1 Like

thank you so much

1 Like

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