fork download
  1. test <- c("i need.to separate the words connected by dots. however, I need.to keep having the dots separating sentences. Look at http://google.com for s.0.m.e more details.")
  2. # Replace each dot that is in between word characters
  3. gsub("\\b\\.\\b", " ", test, perl=TRUE)
  4. # Replace each dot that is in between letters
  5. gsub("(?<=\\p{L})\\.(?=\\p{L})", " ", test, perl=TRUE)
  6. # Replace each dot that is in between word characters, but no in URLs
  7. gsub("(?:ht|f)tps?://\\S*(*SKIP)(*F)|\\b\\.\\b", " ", test, perl=TRUE)
Success #stdin #stdout 0.21s 39112KB
stdin
Standard input is empty
stdout
[1] "i need to separate the words connected by dots. however, I need to keep having the dots separating sentences. Look at http://google com for s 0 m e more details."
[1] "i need to separate the words connected by dots. however, I need to keep having the dots separating sentences. Look at http://google com for s.0.m e more details."
[1] "i need to separate the words connected by dots. however, I need to keep having the dots separating sentences. Look at http://google.com for s 0 m e more details."