Today, Carlo Arenas pointed out[1] that GNU grep didn't work around PCRE2 bug 2642, which Git grep has a workaround for. While installing a GNU grep patch to fix this[2] I noticed that Git's workaround appears to be too pessimistic: on older PCRE2 libraries Git grep sets PCRE2_NO_START_OPTIMIZE even when PCRE2_CASELESS is not set. Attached is a patch to Git that I just now cobbled up and have not even compiled, much less tested. Please feel free to ignore it, as it would merely improve performance on older, buggy PCRE2 libraries and that might not be worth your trouble. I'm sending this email as more of a thank-you for letting us know indirectly of the PCRE2 bug. [1]: https://lists.gnu.org/r/grep-devel/2022-03/msg00004.html [2]: https://lists.gnu.org/r/grep-devel/2022-03/msg00005.html