Open ivanakcheurov opened 5 years ago
Describing rules using a span range of values is a pretty common task.
There should be a recommended standard way of doing it.
Ideas how the ranges could look (in addition to the enumeration [2, 3, 5]: DECISION
).
age:
- 0: new_born
- 1-4: baby
- 5-12: kid
- 13-19: teen
- else: adult
age:
- 0: new_born
- 1...4: baby
- 5...12: kid
- 13...19: teen
- else: adult
age:
- 0: new_born
- 1 up to 4: baby
- 5 up to 12: kid
- 13 up to 19: teen
- else: adult
age:
- 0: new_born
- 1 through 4: baby
- 5 through 12: kid
- 13 through 19: teen
- else: adult
Could also be a mix of enumeration and a span: [1, 2, 5, 7-20]: DECISION
Instead of
allow:
Possible solutions:
between\s+(\d+)\s+and\s+(\d+)
(BDD-style)between {int} and {int}
which is automatically expanded to the previous regex.