Skip to content

Commit de0fd3f

Browse files
author
Olivier Chafik
committed
grammars: document new repetition operators
1 parent f2030e3 commit de0fd3f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

grammars/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ Parentheses `()` can be used to group sequences, which allows for embedding alte
5959

6060
## Repetition and Optional Symbols
6161

62-
- `*` after a symbol or sequence means that it can be repeated zero or more times.
63-
- `+` denotes that the symbol or sequence should appear one or more times.
64-
- `?` makes the preceding symbol or sequence optional.
62+
- `*` after a symbol or sequence means that it can be repeated zero or more times (equivalent to `{0,}`).
63+
- `+` denotes that the symbol or sequence should appear one or more times (equivalent to `{1,}`).
64+
- `?` makes the preceding symbol or sequence optional (equivalent to `{0,1}`).
65+
- `{m}` repeats the precedent symbol or sequence exactly `m` times
66+
- `{m,}` repeats the precedent symbol or sequence at least `m` times
67+
- `{m,n}` repeats the precedent symbol or sequence at betwen `m` and `n` (included) times (included)
68+
- `{,n}` repeats the precedent symbol or sequence at most `n` times (included)
6569

6670
## Comments and newlines
6771

0 commit comments

Comments
 (0)