我試圖從字符串中除去撇號以外的所有標點符號。這裏是我的exastr2 < -R正則表達式除去撇號除外的所有標點符號
str2 <- "this doesn't not have an apostrophe,[email protected]#$%^&*()"
gsub("[[:punct:,^\\']]"," ", str2)
# [1] "this doesn't not have an apostrophe,[email protected]#$%^&*()"
我在做什麼錯?
我有一個壞的標題連接同一個問題:http://stackoverflow.com/questions/8697079/regex-exception-in-r – 2013-03-06 20:57:05