EchoAngel has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I was thinking of creating a function. This function would take in any number of elements from an array and return the largest text that matches all of these elements in the array. In addition, it should also return the left over text that wasn't match. Ie say , @a = ('#$@abc_*^*9' , '*@#$)*ab_(A' , ';lkjnzxcvab'); so i guess ab would be the return value. Any ideas to make this happen and make it simple?

Replies are listed 'Best First'.
Re: Perl : Pattern Matching Idea
by ikegami (Patriarch) on Jan 21, 2005 at 23:38 UTC
    The Longuest Common Substring problem has been addressed previously. 249239, 346119 discuss it, but (at a glance) 308417 seems like the thread to read first.