Regex Matches Overlapping Patterns

Hi,
How could I find overlapping patterns using Matches activity?
For example, I have the string “1-ABCD-AP.1234567” and I have 2 patterns which I have listed here: “1-[A-Z0-9-]{6,8}|AP.\d{6,30}”.
I need both “1-ABCD-AP” which matches the first pattern and “AP.1234567” which matched the second pattern. But the Match Activity returns only “1-ABCD-AP” as the letters “AP” overlap in the 2 patterns.
I know I can do this using For Each activity for each pattern but I have multiple strings and multiple patterns which means that that I have to use For Each activity for each pattern within another For Each activity for each string, therefore I am wondering if there is a more simple solution.
Thank you

@brasheva
Welcome to the Forum

find a demo xaml running multiple patterns and returning a list<Match> here:
RegEx_RunMultiplePatterns.xaml (6.8 KB)

3 Likes

Thank you for your prompt reply!
This is exactly what I am doing now. I am using For Each Activity. But this case with one string and 2 patterns is just an example. Actually I have a big list of strings and and big list of patterns which I should use. So currently I am using For Each activity for each string and within it I am using For Each activity for each patterns. It is working but it is time-consuming, so I am wondering if there is a easiest way to do this with using For Each activity inside another For Each activity.

the for each was only for demo logging - handling the multiple patterns was done within this single assign. Have you noticed this?