invert indices returned by the regexp Index family of functions.