in reply to Re^3: Finding repeat sequences. (only mostly regex)
in thread Finding repeat sequences.
There are no gaps between the repeats, so the uncaptured .* is not required (actually mustn't be there).
And if the second rep is incomplete \1 will never match before $.
I've been trying variations on
$s = 'aaaabaaaabaaaaabaaaab';; $s =~ m[^(.+)\1*(.*?$)] and $1 =~ $2 and print "$1/$2";; aaaabaaaabaaaaabaaaab/
With the idea that any partial rep at the end can be verified again the beginning of the full rep, but it needs to happen inside the regex and cause backtracking.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Finding repeat sequences. (only mostly regex)
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 | |
by BrowserUk (Patriarch) on Jun 18, 2013 at 20:56 UTC |