Pretend that this function exists:
Code:
//returns index of 1st character of substring in haystack that matches needle
//returns -1 if needle not found in haystack
int findStr(char* haystack, char* needle);
So one just uses findStr() on searchstr and delimiter1.
If the index returned is not -1, then offset1 is set to the sum of the index returned and the length of delimiter1.
Then one uses findStr() on searchstr and delimiter2.
If the index returned is not -1, then offset2 is set to 1 less than the index.
We then use substr() on the offsets, perhaps after a check that offset1 <= offset2.