Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1018638]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 20:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found