Assign RegEx matches to an Array or List

Dear UIPath community,

By using ‘for each’ and RegEx matches i managed to find the three correct lab report emails. I need to store the three found adresses and corresponding values to use them later to fill in a report. This is how the first Adress+Values looks like:
pic2

What is the best way to do this? See my workflow below:
Thank you in advance!

HI,

How about to use Dictionary<String, List<String>> type?

Regards,

1 Like

MatchesVariable.Cast(of Match).Select(Function(m) m.value).Toarray

Thank you very much for replying Yoichi, i’m very new to UIPath & VB expressions. I tried printing it out in a message box to understand your tip. How can i print this dictionary in a correct way?

Hi @uiStijn

you can use String.Join Method

String.join(" ", Dict(Match.toString))

regards
Loveleet Saini

@loveleet_Saini
Wohooo thank you Loveleet this works! This is the adress “NormAdres” how do i add/assign the corresponding values “NormWaarde” to this list?
It would look like:
“11100671 - Patrimoniumstraat Aalten Patrimoniumstraat 16 -18Z”, “700 200 100 >15000”

You can use Invoke method after message Box.

In Target Object Give the List Name.
In Method, Use Add

Hey thank you Loveleet!

It worked, i forgot to fill in the parameters!

Hey Yoichi,

What does (m) mean in this expression? Thanks!

Hi,

It’s lambda expression. In this case,iterate each match item of result of Matches activity as m. As a result, this will convert it to list of m.Value (match string).

Regards,

1 Like

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