strsplit("abcdef", "[ace]")strsplit("abcdef", "[acef]")strsplit("abcdef", "[abc]") x <- "abcdef"regmatches(x, gregexpr("[^ace]+", x))
Standard input is empty
[[1]] [1] "" "b" "d" "f" [[1]] [1] "" "b" "d" "" [[1]] [1] "" "" "" "def" [[1]] [1] "b" "d" "f"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!