Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
noprompt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
noprompt
13y ago
> "But I don't think they address the problem inherent in Frak - there's no way to insure that the expression gives the intended result against an arbitrary input." I've made sure to thoroughly test the patterns
2.
▲
by
noprompt
13y ago
> "But that's what a regular expression is used for - testing an arbitrary string for membership within the set of valid strings of the language formally described by the regular expression." Formally yes. And if it were a
3.
▲
by
noprompt
13y ago
Apparently the Perl community has been doing this for years. :)
4.
▲
by
noprompt
13y ago
This is an excellent use case.
5.
▲
by
noprompt
13y ago
I would not use this as a replacement to test the membership of a string in a collection of strings. That's a terrible use case. I've done benchmarks comparing membership checking and regular expression testing and the former is a
6.
▲
by
noprompt
13y ago
This isn't something I would recommend using for everyone. But it does have use cases that make it appealing and useful. The same thing could be said about VerbalExpressions. While it's true `[:alpha:] |[:lower:] ` (even better `(
7.
▲
by
noprompt
13y ago
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 wa
8.
▲
by
noprompt
13y ago
On it's way this week. See the reply above.
9.
▲
by
noprompt
13y ago
There will be a JavaScript version available this later week, both for nodejs and the browser. If you want to try out the command line version see issue #2 for instructions.
10.
▲
by
noprompt
13y ago
Actually, frak doesn't generate patterns that require an exact match. I use Clojure's `re-matches` function (for exact matches) in the example and the tests to show and ensure the generated patterns work as expected. Clojure has a
11.
▲
by
noprompt
13y ago
Isn't that more or less the same as what it already does? That is by telling frak which words you want to match you're implying you don't want to match anything else. Of course, you could generate two patterns; one with the w
12.
▲
by
noprompt
13y ago
Because that's not why I wrote frak. Originally, I wrote it to help eliminate backtracking and, indirectly, minimize the state table of two enormous regular expressions within Vim's Clojure syntax file (the README has a link in th
13.
▲
by
noprompt
13y ago
This is interesting. Thank you for sharing the link to this paper. At the moment I believe I have something that looks similar Figure 1, however, the algorithm is nothing to write home about. I wrote the initial version one afternoon and di