s <- "hello/JJ world/NN" sapply(s, function(x){gsub("([a-zA-Z])/[a-zA-Z]+", "\\1", x)})