Hi,
I had extracted two values using regex form in that I have to find maximum value…Can you please help me on that??
Thank you
Hi,
I had extracted two values using regex form in that I have to find maximum value…Can you please help me on that??
Thank you
Hi @sreemathi.a
Welcome to UiPath Forum!
May I ask, are you looking for the maximum value between the two List (Enumerables) of values ?
yes…
Hi @sreemathi.a
ok, you could try
Math.Max(System.Linq.Enumerable.Max(List1),System.Linq.Enumerable.Max(List2))
where List1 and List2 are initialize and contains Integers
Hello
Welcome to the UiPath community forums!
First you you will need to convert the results to an integer.
Second you will then need to use an IF statement to compare the results. They must be an integer value to do this.
(Away from PC otherwise I would help more)
Hi @sreemathi.a
As @Steven_McKeering correctly indicates you need to identify the result of your regex
Please check the dataType of your enumerable.
Hi @GreenTea @Steven_McKeering
yes my output value is IEnumerable(of Match) datatype and I want convert into integer.
Hi @sreemathi.a
Steps to convert results (dataType: Match) to Integer
My assumption is that Regex have correctly capture the groups.
1.3. Inside For Each, Add to collection
Remember to initialize your List(Of Int32) first before add to collection
Repeat for List2.
Hi @GreenTea
When I used assign: CInt(item.Groups(1).Value) I’m getting complier error as option strict on disallows late binding…
@sreemathi.a - Could you please show your sample text and regex pattern??
In the meanwhile, please take a look at the sample…I have 3 values 1, 21, 2 and you see the max value 21 which is printed correctly…
This is my text and the pattern…
Hope this helps…
My Sample Text is “300 Copay Value…”
Regex form is “\d{1,}”
Can you please share your xaml file??
@sreemathi.a - please try to create a workflow from the screenshot shared and if you face errors let us know. If you ignore string.join you just need only 2 activities.
@sreemathi.a - please ignore those…that was used to show the output of Matches activity…
StrOutputN = String.join(" ",IenRegex)
Write Line
IEnRegex.Max(function(x) (x.ToString))