The expression is:
N | ( 1 { A | B | C | D | E1 | E2 | E3 } )
Meaning the descriptor “N” or one or more of the listed descriptors without repetition.
The best I have got is:
@"^(N|(A|B|C|D|E1|E2|E3){1,})$"
But that does not prevent repetition.
@"^(N|(A{0,1}B{0,1}...)$"
That prevents repetition but then requires a specific order to the elements, which isn’t really OK either.
Any ideas?
(I am not actually sure that the bnf expression itself disallows repetition, but that is what I need.)
Well, you can, but it ain’t pretty:
This solution uses negative lookahead assertions.