Fix a segfault in regex handling

For a regex pattern like "^/path(/.*)?$" the regex parser may
return "no match", setting the offset to UINT_MAX.