Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Finding repeat sequences.

by LanX (Canon)
on Jun 18, 2013 at 19:09 UTC ( #1039632=note: print w/ replies, xml ) Need Help??


in reply to Finding repeat sequences.

> Eg. In abcdabcdabceabcdabcdabceab; abcd is a false rep; the required rep is abcdabcdabce;

since regex are greedy, this works for me

DB<131> $_='abcdabcdabceabcdabcdabceab' => "abcdabcdabceabcdabcdabceab" DB<132> ($match)= /(.+)\1/ => "abcdabcdabce"

edit: I doubt that the answer is so simple, but this should give you a start to ask more precisely...

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re: Finding repeat sequences.
Select or Download Code
Re^2: Finding repeat sequences.
by BrowserUk (Pope) on Jun 18, 2013 at 20:01 UTC

    Please see Re^2: Finding repeat sequences..


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2014-10-31 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (219 votes), past polls