So, here's what I'm trying to do, although I've been struggling with that for some time.
Let's say we have this input:
{{something|a}} text text {{another|one|with|more|items}}
What I'm trying to achieve:
[
["something", "a"],
["another", "one", "with", "more", "items"]
]
The simple way would be something like:
"{{something|a}} text text {{another|one|with|more|items}}".scan(/([^\|\{\}]+)/)
But this yields - quite predictably so - all the results in a single array (also note that I do not want "text text" in the results, just the items IN the curly braces):
[["something"], ["a"], [" text text "], ["another"], ["one"], ["with"], ["more"], ["items"]]
I then tried doing it like (see script here):
\{\{(([^\|\{\}]+)\|?)+\}\}
But I must be doing something wrong.
Any help will be appreciated! :)