[regex] avoid an unnecessary comparison

when the index is op is used, it always returns -1 for start indexes
beyond the string length