I'm trying to create a regular expression that lists all combinations of numbers and uppercase letters, text between square brackets and text between straight double quotes.
The regular expression works on regex101 but I cannot get it to work in KM.
Not sure what you mean by “as in matches”. Regarding the context: I want to collect all non-translatables (invariants) in every source segment and to be able to insert them in the corresponding target segment.
On second thought: I guess that I cannot combine regexes with pipes. I’ll have to place each regex in a separate Search action.
You can do this, and your macro was doing it, but you were, I believe, overcomplicating the loop. Your Local_sourceSegment is extracting all the right matches, so you don't need to regex the stuff again within the loop: You have all the substrings, so you just need to assemble them.
Unless I'm missing something about the objective, this seems to work perfectly:
Remember that, unlike default regex101 patterns, the KM "Search using Regular Expression" action only returns the first match. That's why you need to use a "For Each" loop or similar, nothing to do with "pipes".
If you want to match something "two or more times", try {2,} for "at least two and as many as possible, with no upper limit":
([A-Z0-9]{2,})|\[.*?\]|\".*?\"
It doesn't change the logic in your pattern, but might make it a little more readable (and it's a tad more efficient).
Uncheck the "Sort Entries" option in the gear menu for the Prompt With List action.
You'd need the Prompt With List in a repeat loop, where you remove a row from the variable each time it's pasted, then presents the list again until there are no more lines in the variable. I don't have the time to dig into that, though, but it should be doable.