Fix bug #11519 with relocation of buffer text during regex search.