http://www.perlmonks.org?node_id=1018696


in reply to A regex that only matches at offset that are multiples of a given N?

/\G(?:.{4})*(?=fred(....))/sg
will work if you're okay with overlapping matches. If not, you could resort to using the slower
/fred(?(?{ pos % 4 != 0 })(?!))(....)/sg