SERVER-48116 fixed a startup bug in the venerable C++ bindings for the PCRE library. We can keep going with a local patch, but that change cannot be upstreamed because the PCRE project is not even taking bug fixes anymore (see https://bugs.exim.org/show_bug.cgi?id=2575 ).
The very strong recommendation from the PCRE author is to migrate to the successor, PCRE2, which is under active maintenance. It is compatible, but not bug-for-bug compatible. It provides a similar C API as PCRE, but does not ship with a C++ wrapper. C++ wrappers for PCRE2 are available from third parties, reflecting some diversity of style. Some are quite featureful, e.g., https://github.com/jpcre2/jpcre2 .
The PHP project made this transition in 2018, and generated some compatibility notes. The main difference is that invalid regexes are more zealously rejected:
We would have to consider what in the server could change in such an upgrade.
The pcrecpp.h header is included in only a few files. Of those, we can eliminate places that are internal, testing, or hardcoded regexes. Or places that only need quoteMeta or other supporting functions. Those can all be adjusted if necessary. All that's left is two sites:
So query team would be best able to evaluate the impact of the upgrade.