in reply to Re^2: Merging Two Strings
in thread Merging Two Strings
The maximal overlap rule conflicts with the last-overlap rule. Doing maximal overlap is easier than what I posted (you remove the first capture group and substitute nothing in). And changing the + to a * ensures that the space gets removed, even if the overlap is empty. Does this conform to your understanding of the specs?
$catted =~ s/(.*) (?=\1)//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Merging Two Strings
by GrandFather (Saint) on Oct 27, 2005 at 19:43 UTC | |
by Roy Johnson (Monsignor) on Oct 27, 2005 at 19:47 UTC | |
|
Re^4: Merging Two Strings
by sauoq (Abbot) on Oct 27, 2005 at 21:49 UTC |