Implement two speed optimized string search functions

Your job is to implement the following two functions that are used to search an array of strings from a given string without case sensitivity.

FastPosExArr(const SubStrs : Array of String; const Str : String);

* Finds the first occurrences of the given SubStrs from Str. The way you return the results (array of integer) is up to you, either use a var parameter or return as a function result. The function is case insensitive.

The implementation is basically an optimized version of this:

for i := low(SubStrs) to high(SubStrs) do result[i] := Pos(LowerCase(SubStrs[i]), LowerCase(Str));

But instead the above implementation, I want you to iterate through the given input Str only one time and search for the given array of SubStrs during the single iteration and quit the iteration as soon as the first occurrence of *each* SubStrs is found.

Since I am using only two or three SubStrs for over 95% of cases, I want you to also implement the following for maximal optimization:

* Finds the first occurrences of the given SubStrs from Str. The function exists as soon as it finds the first hit, therefore the result of this function is the index of which SubStrs it found from Str and the index of which position it was found. The function is case insensitive.

The implementation is basically an optimized version of this:

for i := low(SubStrs) to high(SubStrs) do

begin

Temp := Pos(LowerCase(SubStrs[i]), LowerCase(Str));

If Temp > 0 then

begin

ResultArrIdx := i;

ResultPos := Temp;

Break

End;

End;

But instead the above implementation, I want you to iterate through the given input Str only one time and search for the given array of SubStrs during the single iteration and quit the iteration as soon as the first occurrence of *any* SubStrs is found.

Since I am using only two or three SubStrs for over 95% of cases, I want you to also implement the following for maximal optimization:

Your implementation must work with Delphi 2010 and the implementation must be pure Delphi, no assembler. Please only make a bid if you can do this right now, and you have experience with this kind of work. Do not bid if you are not sure whether you can make these functions faster than the sample implementation codes above.