Use the '&' operator for Each, instead of '+ or '|'. If you must have all, but in unpredicatable order use:
Literal('alpha') & 'beta' & 'gamma'
If some may be missing, but each used at most once, then use Optionals:
Optional('alpha') & Optional('beta') & Optional('gamma')
Oops, I forgot the '|' delimiters. One lenient parser would be to use a delimitedList:
delimitedList(oneOf("alpha beta gamma"), '|')
This would allow any or all of your choices, but does not guard against duplicates. May be simplest to use a parse action:
itemlist = delimitedList(oneOf("alpha beta gamma"), '|')
def ensureNoDuplicates(tokens):
if len(set(tokens)) != len(tokens):
raise ParseException("duplicate list entries found")
itemlist.setParseAction(ensureNoDuplicates)
This feels like the simplest approach to me.
-- Paul