in reply to Re: Finding repeat sequences. (only mostly regex)
in thread Finding repeat sequences.
I assume that the pattern must repeat at least twice, otherwise, the full string is always the longest answer.
I wish that were the case. It mostly will be, but sometimes the string will consist of 1 complete and 1 partial rep.
But the partial rep at the end *will* exactly match the same number of characters at the beginning of the string, so it will always be possible to determine the rep.
But how to encode that in a regex or at least avoid a brute force chop and compare?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Finding repeat sequences. (only regex)
by tye (Sage) on Jun 18, 2013 at 20:13 UTC | |
by BrowserUk (Patriarch) on Jun 18, 2013 at 20:21 UTC | |
by tye (Sage) on Jun 18, 2013 at 21:17 UTC | |
|
Re^3: Finding repeat sequences. (only mostly regex)
by choroba (Cardinal) on Jun 18, 2013 at 20:10 UTC | |
by BrowserUk (Patriarch) on Jun 18, 2013 at 20:18 UTC | |
by choroba (Cardinal) on Jun 18, 2013 at 20:23 UTC | |
by BrowserUk (Patriarch) on Jun 18, 2013 at 20:41 UTC | |
by choroba (Cardinal) on Jun 18, 2013 at 20:44 UTC | |
|