【发布时间】:2014-04-06 02:59:52
【问题描述】:
我想删除包含除 c#/c++ 之外的特殊字符的单词。我也喜欢删除句子中的 url。
例如,我的输入是:
x <- "Google in the la#d of What c# chell//oo grr+m my Website is: c++ http://www.url.com/bye"
我正在做的是
gsub("http://(\\S+)|\\s*[\\^w\\s]\\s*[^c#c++\\s]","",x)
我的预期输出是
"Google in the of What c# my Website c++"
但我得到了
"Google in the la#d of What c# chell//oo grr+m my Webte i c++ "
【问题讨论】: