2

Is there a parser like plus() that has an upper boundary, to model expressions like Item <- [a-zA-Z0-9]{1,5}?

Similarly for something like Item <- [a-zA-Z0-9]{3,5}?

Behrang
  • 46,888
  • 25
  • 118
  • 160

1 Answers1

1

Yes, the repeat operator does that:

Parser item = word().repeat(1, 5);

Check the JavaDoc for additional information.

Lukas Renggli
  • 8,754
  • 23
  • 46