in reply to A regex that only matches at offset that are multiples of a given N?
will work if you're okay with overlapping matches. If not, you could resort to using the slower/\G(?:.{4})*(?=fred(....))/sg
/fred(?(?{ pos % 4 != 0 })(?!))(....)/sg
In Section
Seekers of Perl Wisdom