I'm trying to use a regular expression of the form
"foo\\(?:\\(bar\\)\\(baz\\)\\)*\\(quux\\)", but I want the inner two subexpressions to retain all of their matches, not just the first one. I realize this may be impossible to achieve as stated, so I'll give more detail about why I want this to work.
My specific case is that I'm trying produce a major mode for editing and highlighting Dwarf Fortress "raw" files. The regular expression I'm having this trouble with is
, which successfully matches a single complete raw tag with all of its parameters; however, capturing groups 3 and 4 only end up containing the last parameter (after having successfully matched all the previous ones), and therefore all but the last parameter is not highlighted by
font-lock. I understand why this is the case, but I'd like to know if there is a way to get around it, or to otherwise enable my desired behavior.