s <- "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
if (stri_install_check(silent=TRUE))
stri_replace_all_regex(s, ".*? ", "#")
if (stri_install_check(silent=TRUE))
stri_replace_all_regex(s, "(el|s)it", "1234")
if (stri_install_check(silent=TRUE))
stri_replace_all_regex('abaca', 'a', c('!', '*'))
if (stri_install_check(silent=TRUE))
stri_replace_all_regex('123|456|789', '(\\p{N}).(\\p{N})', '$2-$1')
if (stri_install_check(silent=TRUE))
stri_replace_all_regex(c("stringi R", "REXAMINE", "123"), '( R|R.)', ' r ')
Run the code above in your browser using DataLab