Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created September 27, 2011 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ingydotnet/1243907 to your computer and use it in GitHub Desktop.
Save ingydotnet/1243907 to your computer and use it in GitHub Desktop.
I'm leaning towards this syntax. % is an inix operator and always separated by
whitespace:
<a>* % <b> - zero or more <a> separated by <b>
<a>+ % <b> - one or more
<a>+ %% <b> - one or more, optional trailing b
<a>2+ % <b> - two or more
<a>2-5 % <b> - two to five
<a> % <b> - possible synonym for <a>* % <b>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment