pcre2_set_optimize
Name
pcre2_set_optimize - set an optimization directive
Synopsis
#include <pcre2.h>
int pcre2_set_optimize(pcre2_compile_context *ccontext,
uint32_t directive);Description
This function controls which performance optimizations will be applied
by pcre2_compile(). It can be called multiple times with the same compile
context; the effects are cumulative, with the effects of later calls taking
precedence over earlier ones.
The result is zero for success, PCRE2_ERROR_NULL if ccontext is NULL,
or PCRE2_ERROR_BADOPTION if directive is unknown. The latter could be
useful to detect if a certain optimization is available.
The list of possible values for the directive parameter are:
PCRE2_OPTIMIZATION_FULLEnable all optimizations (default)
PCRE2_OPTIMIZATION_NONEDisable all optimizations
PCRE2_AUTO_POSSESSEnable auto-possessification
PCRE2_AUTO_POSSESS_OFFDisable auto-possessification
PCRE2_DOTSTAR_ANCHOREnable implicit dotstar anchoring
PCRE2_DOTSTAR_ANCHOR_OFFDisable implicit dotstar anchoring
PCRE2_START_OPTIMIZEEnable start-up optimizations at match time
PCRE2_START_OPTIMIZE_OFFDisable start-up optimizations at match time
There is a complete description of the PCRE2 native API, including detailed
descriptions of directive parameter values, in the
pcre2api
page.