On Fri, 27 Aug 2004, Mark Maunder wrote:

I've google'd and CPAN'd and no luck. Is there a tool out there that will generate a regular expression based on a series of string inputs that are similar but have parts that differ[?]

I suspect that this is a Hard problem, as in NP-Hard/NP-Incomplete, as:

    <http://en.wikipedia.org/wiki/NP-hard>
    <http://en.wikipedia.org/wiki/NP-complete>

    <http://mathworld.wolfram.com/NP-HardProblem.html>
    <http://mathworld.wolfram.com/NP-Problem.html>
    <http://mathworld.wolfram.com/NP-CompleteProblem.html>

Rather than trying to find a tool for this, you'll be much better off trying to come up with an understanding of what within the patterns that you match are the qualities that you want to match against, and then finding a way to express this terms that the computer, by way of regular expressions, can understand your intent.

My hunch is that flinging a bunch of text at some kind of regex maker and telling it to figure out on its own how to match or not match different examples is going to be a variant of the halting problem.

    <http://en.wikipedia.org/wiki/Halting_problem>
    <http://mathworld.wolfram.com/HaltingProblem.html>

And I'd be stunned if you could solve that by the end of the day :-)


-- Chris Devers

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to