Currently nginx is compiled with the PCRE3 library and all modules using PCRE must be compiled with the same version (PCRE3). I made practical test, nginx compiled with PCRE2 and lua compiled with PCRE3 and didn't work.