Ah yes, atomic grouping seems to help indeed! One can never read pcre.txt enough smile I'll test more but so far it works like a charm.

The reason Kelder's doesn't work is that he uses . instead of [^i] just before the (?1) call.