News for hackers. Stuff that matters.
Re:Generate Regex from Examples by qu4z-2 on Sunday July 26, 2015 @11:12PM (#9953141)
If the inputs are

    +ve: a | aaa | aaaaaaa | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    -ve: b | 1000 | cd
a+ would by most measures be a "smaller" regular expression than a|aaa|aaaaaaa|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

No?

EDIT: Formatting.

Re:Generate Regex from Examples by brudgers on Monday July 27, 2015 @01:45AM (#9953553)
If we imagine aa is an accepting state, then we can imagine that a+ is a good return value. And it's easy. That doesn't mean it's a good idea since accepting aa may be a bug in our larger code.
Re:Generate Regex from Examples by qu4z-2 on Monday August 03, 2015 @10:53PM (#10001376)
Well, any heuristic like that is possibly going to give either false positives or false negatives when applied to a set larger than the training data. A pure white-list approach is definitely an option for determining the accepted inputs, but generally some heuristic that attempts to accept inputs "like" the examples will probably be better.