in reply to Perl : Pattern Matching Idea

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.