fork download
  1. string <- "The qu!ck, brown fox jumps over the `lazy` d*g!"
  2. gsub(pattern = "([[:punct:]])",replacement="\\\\\\1",string)
Success #stdin #stdout 0.31s 175424KB
stdin
Standard input is empty
stdout
[1] "The qu\\!ck\\, brown fox jumps over the \\`lazy\\` d\\*g\\!"