I am having a string like this:
%1n--%2n##%12n
I need all matches that match %1n, %2n, %12n and I also need all not matching parts. E.g: -- and ##
My regex pattern is (%\d*n)(?!(%\d*n)*).
I get the matching parts (%1n, ...) and also empty matches from all non-matching parts. But the result for my example should be:
- Match: %1n
- Match: --
- Match: %2n
- Match: ##
- Match: %12n
Can somebody tell me the correct regex pattern to get my expected result?