Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Finding a repeating substring with a regex

by kvale (Monsignor)
on Apr 15, 2006 at 08:29 UTC ( #543510=note: print w/replies, xml ) Need Help??


in reply to Finding a repeating substring with a regex

First you must find the repeating unit. Try this:
use re 'eval'; $_ = q'abczdefzabcghijklzabczaerabrtyuabcethdauthabkudiabc'; if (/([a-z]{3}).+?\1/) { $unit = $1; m< ( (?{ push @found, pos() }) $unit ) \G .+? \1 >gx; print join ', ', @found, "\n"; }

-Mark

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://543510]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-12-06 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (118 votes). Check out past polls.