Hi,

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. Ideally I'd like to be able
to create an regex generator object into which I can feed strings. Then
call a method that will output some generic regex that will match all
the strings that were fed in and capture the parts that differ into
$1..$9 variables. Of course I could add the capturing brackets myself,
but the generic regex is what I'm after.

I really hope this exists cos it's friday and writing it is going to be
- er - challenging. I was thinking I'd take the first string and
generate regex that matches it. Then I'd take the next string that is
fed in and try and match it with the generated regex starting at the
beginning of the regex until it breaks. Then insert a (.+?) or [^<]+<
(if the next matching char is a <) until I end up with regex that now
matches two strings. Then repeat the process until I end up with
something that matches all strings - which may very well be .*  But hey,
at least I can go off on my weekend with a sense that I tried to make a
difference. ;-)

Mark.



-- 
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