fork download
  1. text <- "categories: crime, punishment, france\nTags: valjean, javert,les mis\nAt the end of the day, the criminal Valjean escaped once more."
  2. sub("(?n)^categor(?:.*\n){2}", "", text)
  3. sub("^categor(?:.*\n){2}", "", text, perl=TRUE)
Success #stdin #stdout 0.19s 183680KB
stdin
Standard input is empty
stdout
[1] "At the end of the day, the criminal Valjean escaped once more."
[1] "At the end of the day, the criminal Valjean escaped once more."