set_regexpr_style() selects the style explicitly.
auto_set_regexpr_style() chooses based on OS (TRE on Windows; PCRE elsewhere).
set_PCRE() and set_TRE() force the style.
set_PCRE()set_TRE()
use_perl()
set_regexpr_style(style)
auto_set_regexpr_style()
Logical indicating whether to use perl
one of 'PCRE' or 'TRE'
Guangchuang Yu
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().
https://stackoverflow.com/questions/47240375/regular-expressions-in-base-r-perl-true-vs-the-default-pcre-vs-tre