I am sending updated version - it allow third optional argument that specify where searching should to start. With it is possible repeatably call this function.
What happened to returning an array of offsets? I think that would be both easier to use than this version as well as performing better.
I see you dropped multi-dimension support, but I think that's fine.
-- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com