set_regexpr_style()selects the style explicitly.auto_set_regexpr_style()chooses based on OS (TRE on Windows; PCRE elsewhere).set_PCRE()andset_TRE()force the style.
Details
These functions do not change the behavior of gsub()/regexpr() directly.
They set a global option that you can read via use_perl() and pass to gsub()/regexpr().