x <- "Hi hi missing u lollol hahahahalol sillybilly haaaaa!"gsub("(\\w)\\1+(*SKIP)(*F)|(\\w+?)\\2+", "\\2", x, perl=TRUE)
Standard input is empty
[1] "Hi hi missing u lol halol sillybilly haaaaa!"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!