Comma separated Unordered group [message #1095579] |
Tue, 27 August 2013 08:36 |
georges.chaudyskyscanner.net Georges Messages: 5 Registered: August 2013 |
Junior Member |
|
|
Hi guys,
I am trying to right a a rule that handle a comma separated unordere group.
For example, I like to be able to write :
a, b, c
b, a, c
...
c, b, a
But not
a, a (twice a)
c, b, c (twice c)
The following rule gives me the unordered group but not the commas
Model : a?='a' & b?='b' & c?='c'
The following gives me both the unodreded part and the commas, but not the uniqueness:
Model : elems+=Elem (',' elems+=Elem)*
Elem : a?='a' | b?='b' | c?='c'
thus i can have a, b, a, b
Is there a way to have both?
Regards
Georges
|
|
|
Re: Comma separated Unordered group [message #1096316 is a reply to message #1095579] |
Wed, 28 August 2013 08:16 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
Model: (a?='a'','|a?='a') & (b?='b'','|b?='b') & (c?='c'','|c?='c');
Was my first idea, the commas are optional in that case, which is...close to what you might need. If the sequence could end with a comma it would actually already work.
Explicitly stating the combinations wouldn't be workable either past three elements, I guess.
You could also take a different approach and take the second option, go with that and check for uniqueness in the validator. That might be the best solution.
[Updated on: Wed, 28 August 2013 08:21] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02047 seconds