subject <- "Some [string] here and [there]"gsub("\\[[^]]*]", "", subject)
Standard input is empty
[1] "Some here and "
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!