Substitute regular expressions in a string with another string.
re_substitutes(data, pattern, replacement, global = FALSE, options = NULL, ...)regexp Section "Perl-like Regular Expressions" for a
discussion of the supported options
string <- c("this is a Test", "string")
re_substitutes(string, "test", "not a test", options = "insensitive")
#> [1] "this is a not a test" "string"
re_substitutes(string, "i", "x", global = TRUE)
#> [1] "thxs xs a Test" "strxng"
re_substitutes(string, "(test)", "not a \\1", options = "insensitive")
#> [1] "this is a not a Test" "string"