fork download
  1. data <- data.frame(
  2. datalist = c("anarchism is a wiki/political_philosophy that advocates wiki/self-governance societies based on voluntary institutions",
  3. "these are often described as wiki/stateless_society although several authors have defined them more specifically as institutions based on non- wiki/hierarchy or wiki/free_association_(communism_and_anarchism)",
  4. "anarchism holds the wiki/state_(polity) to be undesirable unnecessary and harmful",
  5. "while wiki/anti-statism is central anarchism specifically entails opposing authority or hierarchical organisation in the conduct of all human relations"),
  6. stringsAsFactors=FALSE)
  7.  
  8. trimws(gsub("wiki/(\\S+)|(?:(?!wiki/\\S).)+", " \\1", data$datalist, perl=TRUE))
Success #stdin #stdout 0.23s 39468KB
stdin
Standard input is empty
stdout
[1] "political_philosophy  self-governance"                                   
[2] "stateless_society  hierarchy  free_association_(communism_and_anarchism)"
[3] "state_(polity)"                                                          
[4] "anti-statism"