Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: A regex that only matches at offset that are multiples of a given N?

by choroba (Abbot)
on Feb 13, 2013 at 16:31 UTC ( #1018570=note: print w/ replies, xml ) Need Help??


in reply to Re^2: A regex that only matches at offset that are multiples of a given N?
in thread A regex that only matches at offset that are multiples of a given N?

Why have you removed the ^ anchor?

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re^3: A regex that only matches at offset that are multiples of a given N?
Download Code
Re^4: A regex that only matches at offset that are multiples of a given N?
by BrowserUk (Pope) on Feb 13, 2013 at 16:36 UTC

    Because with it, it only matches the first match; not any second or subsequent properly aligned matches?:

    print "$-[0]: $1" while $a =~ m[(?:.{4})*(?=(aa..))]g;; 0: aawx 404: aawx 405: aadz 481: aadz print "$-[0]: $1" while $a =~ m[^(?:.{4})*(?=(aa..))]g;; 0: aawx print "$-[0]: $1" while $a =~ m[(?:.{4})*(?=(gg..))]g;; 0: gghn 208: gghn 211: ggyj 955: ggyj print "$-[0]: $1" while $a =~ m[^(?:.{4})*(?=(gg..))]g;; 0: gghn

    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://1018570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-09-01 13:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (12 votes), past polls