Thanks for the reply. Really helped a lot to a parboiled newbie like me.oneOrMore('/' ~ id ~ &('/' ~ id)) ~ '/' ~ 'id' is really a good example for the '&' combinator. But can only solve this particular case and is not a general solution. For example, what if we need to capture the last two matches separately?
The proposal of extended `times` operator is interesting, looks like a more general "non-greedy" implementation. But I failed to relate these with the `times` introduced in the document which has the shape of `(1 to 5).times(rule)` or `3.times(rule)`. Some elaboration would be greatly appreciated.
def groupIdsAndArtifactName: Rule2[Seq[String], String] = rule {
('/' ~ capture(id) ~ groupIdsAndArtifactName ~> { (oldStr: String, seq: Seq[String], newStr: String) =>
(oldStr +: seq) :: newStr :: HNil
}) | ('/' ~ capture(id) ~> { str: String => Seq() :: str :: HNil })
}