Re:Frak takes an entirely different approach to generating r...
by samatman on Thursday August 15, 2013 @12:04PM
(#6218678)
You're asking for implicit induction, which is not what the user would want in the general case. "a" "aaa" "aaaaa" could be expanded to "a(aa){0,2}" through deduction, and no more.
since frak is using a trie, this kind of encoding should be a conceptually straightforward extension of the existing parse structure.
Re:Frak takes an entirely different approach to generating r...
by noprompt on Thursday August 15, 2013 @01:18PM
(#6219294)
These expansions are certainly possible and I'm planning to investigate whether they have performance benefits. One interesting discovery we made last weeks is that `(a|b|c)` actually produces a larger state table than `[abc]`. This was both the case for Java and Vim. While the performance gains are minute, nevertheless, they are gains.
I haven't checked if "a{4}", for example, is faster than "aaaa" or produces fewer states. But it's something I am interested in. I just haven't had enough time this week.
So it doesn't seem like you could feed it "a", "aaa", "aaaaa" and then get "a+".
But even if it did, it would seem there would be so many edge cases in what the "correct" regular expression should be, that specifying them all would be just as hard as writing the regular expression in the first place.
But nevertheless, definitely a cool little toy. Would be great to have a web front end to test it out, as webjames said.