in reply to Re^2: Finding repeat sequences. (only mostly regex)
in thread Finding repeat sequences.
Note that, based on that definition, if the first and last characters are the same, then the answer is "the string minus the last character". Which leads to:
/^(.+?).*\1$/
Which leads to a full solution of:
/^((.*?).*?)\2*\1$/
which might be horribly inefficient (at least for some cases) or might not; I haven't considered it.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Finding repeat sequences. (only regex)
by BrowserUk (Patriarch) on Jun 18, 2013 at 20:21 UTC | |
by tye (Sage) on Jun 18, 2013 at 21:17 UTC |