Which position in the string caused the regular expression to fail?
stackoverflow.com
stackoverflow.com
"the longest prefix string of the input where a suffix exists that would cause the regex match to succeed" is well-defined and easily determined (by looking at the characters a normal regex engine inspects during matching).
The character after that should be the asked for offset. That could be one more than the length of the string, for example when looking for a digit in a string that doesn't contain one.