Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created September 19, 2011 07:56
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/1226129 to your computer and use it in GitHub Desktop.
Save ingydotnet/1226129 to your computer and use it in GitHub Desktop.
18:46 < ingy> I am finding the ** syntax less and less usefu :(
18:46 < ingy> useful
18:47 < ingy> it seems I never want just a ** b
18:48 < ingy> I want [a ** b]? or a [ b a ]+
18:50 < soh_cah_toa> ingy: you're saying the ** quantifier doesn't work inside non-capturing groups?
18:52 < ingy> no
18:53 < ingy> I'm saying that matching one or more a's separated by b's is not useful to me yet
18:53 < ingy> I seem to want 0 or more or 2 or more
18:54 < ingy> so the special ** syntax for one or more feels yagni at the moment
18:54 < ingy> I'm sure ** is more generalized in p6 than what I am using it for
18:55 < ingy> but i feel like I wasted my time implementing it in pegex
18:56 < soh_cah_toa> ah, ok
18:56 < ingy> then again, a [ b a ]* has a subtle difference than a ** b
18:57 < ingy> in that I had to return the result of the first as [a,[a,a,...]]
18:57 < ingy> but with ** I can return [a,a,a,...]
18:57 < ingy> which is much cleaner
18:59 < ingy> sigh. I'll pester moritz tomorrow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment