s <- "aaehhhhhhhaannd"strsplit(s, "(?<=(.))(?!\\1)", perl=TRUE)
Standard input is empty
[[1]] [1] "aa" "e" "hhhhhhh" "aa" "nn" "d"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!