in reply to Re^3: Merging Two Strings
in thread Merging Two Strings

That merges ATGATG and ATGATG as ATGATG - not wnat OP gave as an explicit example.

The problem is that a regex finds the first match, which may not be the best match. In this case the first match is the whole string, the best match is the last repeated substring (ATG).


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^5: Merging Two Strings
by Roy Johnson (Monsignor) on Oct 27, 2005 at 19:47 UTC
    Yes, there are conflicting specs. The OP now states that if two patterns are equal, it simply returns one of them (ie, the whole thing matches). If you want the other behavior, look a couple of posts up and you'll see where I solved it (and saouq complained about it, leading to the solution you're now criticizing).

    Caution: Contents may have been coded under pressure.