|
Locally, I've successfully been able to compile the pcre2 dependency and include #include <pcre2.h> everywhere we include pcre.h. The only caveat is that with pcre2 we need to define the macro PCRE2_CODE_UNIT_WIDTH before we include the header file.
pcrecpp.h is another matter. pcre2 doesn't have an official cpp library, as noted by SERVER-48232, so we would have to use an external library like jpcre2 or pcre2pp. This is a second dependency on top of just pcre2. I'll check if each of these compile.
|
|
I believe this project should take about 1-2 sprints for all of the work. Most of the functionality we use from PCRE has rough equivalents in PCRE2. I've made a document with details.
The main change we will have to incorporate is that the function for matching patterns now stores its results in a match_data block, which must be processed using API functions, rather than just returning a vector of offsets to substrings it has matched. Additionally, the process for freeing memory is different; there are specific functions for certain types of data, rather than just a generic pcre_free function. Other than that, the rest of the API we use has pretty exact equivalents in PCRE2.
|