mystring <- "abc[de"gsub("[\\[\\]$]","",mystring, perl = TRUE)gsub("[][$]","",mystring)
Standard input is empty
[1] "abcde" [1] "abcde"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!