Find duplicate number in regex

Hello guys, here is my extracted data with regex
i need to get only one duplicate which is 4500043209 is it possible?
thank you !

Hi @Aluneth_X,
Output of regex is IEnumerable type so you can use For Each to write down each element to table for example. Then you can sort the table and compare each element to the next one. If they are similar, remove element.

Hello guys, so here is the extracted data from regex
the regex pattern is “45000\d+”

now i need only one value frrom duplicate number which is 4500043690
so the output should be only 4500043690
any help would be apreciated
thank you

this regex - How do I find and remove duplicate lines from a file using Regular Expressions? - Stack Overflow maybe helps you


Sort the numbers, replace comma with space and use this regexp as example regex101: build, test, and debug regex

Please don’t double post about the same case. You can just update your first one.

Hello @Aluneth_X
You can use this pattern “\b(\w+)\s+\1\b” as suggested by @c.ciprian
but this will only work if the repeated value comes next to the original value
Use this code in an assign activity it’ll get all the duplicate value regardless of its position

Output.GroupBy(Function(r) r.Value).Where(Function(g) g.Count>1).Select(Function(r) r.Key)

Check this workflow for better understanding
GroupByDuplicateValues.xaml (8.2 KB)


thank u good sir

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