The expressions preprocess(x, erase = pattern, lower_case = TRUE)
and
preprocess(x, erase = pattern, lower_case = FALSE)
are roughly
equivalent to tolower(gsub(pattern, "", x))
and
gsub(pattern, "", x)
, respectively, provided that the regular
expression 'pattern' is correctly recognized by R.
Internally, preprocess()
converts the string 'pattern' is converted
into a C++ std::regex
class by the default constructor
std::regex::regex(std::string)
.