x <- c( "Welcome to A I: the best W O R L D!", "Hi I R is the B O M B for sure: we A G R E E indeed." ) gsub("(?:(?=\\b(?:\\p{Lu}\\h+){2}\\p{Lu})|\\G(?!\\A))\\p{Lu}\\K\\h+(?=\\p{Lu})", "", x, perl=TRUE)