DBGQuery: New function, extractSubstringAndIndex

Return the substring and its suffix array index.