0
$\begingroup$

Given some strings, is there some algorithm (and program that implement such an algorithm) that can create a regex which matches some of the given strings and not the other given strings?

Note that the given strings are not all the strings that will be met by the regex. I hope the regex can generalize well on other strings not given (just like machine learning algorithms), but not necessarily achieve 100% accuracy.

Also it will be great if such an algorithm can take into account the efficiency of implementing regex matching

Thanks.

$\endgroup$
  • $\begingroup$ How many strings some refers to in which matches some of the given strings and not the other given strings? ? it may be 2,3,4 ...?! $\endgroup$ – M a m a D Mar 14 '15 at 17:14
  • 1
    $\begingroup$ regex.inginf.units.it - the first hit for the "automatic regex generation" search on Google $\endgroup$ – HEKTO Mar 14 '15 at 17:17