Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^7: A regex that only matches at offset that are multiples of a given N? (Update:almost perfect!)

by smls (Friar)
on Feb 13, 2013 at 21:11 UTC ( #1018638=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while( $input =~ m{\G(?:.{$n})*?(?=fred(....))}g ) {
        pos($input) += $n;
    
    ...
        # do stuff with $1
        # ...
    }
    
  2. or download this
        pos($input) += $n * int((length('fred'.$1) - 1) / $n + 1);
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-11-29 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (203 votes), past polls