fork download
  1. input <- "this is my 'example'"
  2. change <- "\\1test"
  3. stringr::str_replace(input, "'[^']*'", paste0("'", change, "'"))
  4. gsub("'[^']*'", paste0("'", change, "'"), input)
Success #stdin #stdout #stderr 0.28s 42532KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error in stri_replace_first_regex(string, pattern, fix_replacement(replacement),  : 
  Trying to access the index that is out of bounds. (U_INDEX_OUTOFBOUNDS_ERROR)
Calls: <Anonymous> -> stri_replace_first_regex -> .Call
Execution halted