我有一个类似的代码(我在这里得到):
m<- c("Hello! #London is gr8. I really likewhatishappening here! The alcomb of Mount Everest is excellent! the aforementioned place is amazing! #Wow")
x<- gsub("\\<[a-z]\\{4,10\\}\\>","",m)
x
我尝试了其他方法,比如
m<- c("Hello! #London is gr8. I really likewhatishappening here! The alcomb of Mount Everest is excellent! the aforementioned place is amazing! #Wow")
x<- gsub("[^(\\b.{4,10}\\b)]","",m)
x
我需要删除长度小于 4 或大于 10 的单词。我哪里错了?