Yes, the common parts can occur anywhere in the string. The reference was only to show the closest bit of code I could find using google, which happened to be on this list. I expect if there's a neat way to do it, somebody on this list knows how.
Restated- given two texts, find the longest identical contiguous substrings, starting anywhere in either string. -Daniel On Thu, 14 Feb 2002, Stephen Turner wrote: > On Thu, 14 Feb 2002, Daniel R. Allen wrote: > > > Hi, > > > > Somebody asked on the Toronto Perlmongers list about finding the longest > > common (consecutive) substring of two thousand-character texts using perl. > > I've given a quick search and can find nothing definitive. [1] > > > > What exactly are the rules? The reference [1] seems to be looking for the > common substring to occur in the same place in the two strings. But in your > case, do you allow the common parts to occur anywhere within the two > strings? > > -- > Stephen Turner, Cambridge, UK http://homepage.ntlworld.com/adelie/stephen/ > "This is Henman's 8th Wimbledon, and he's only lost 7 matches." BBC, 2/Jul/01 > >