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 reply to Re: A regex that only matches at offset that are multiples of a given N?
by ikegami
in thread A regex that only matches at offset that are multiples of a given N?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |