fork download
  1. targettext <- c("DOG MOUSE CAT","DOG MOUSE:CAT","DOG_MOUSE9CAT","MOUSE9CAT","DOG_MOUSE")
  2. searchwords <- c("MOUSE","FROG")
  3. grep(paste0("(?<![A-Z])(?:", paste(searchwords, collapse = "|"), ")(?![A-Z])"), targettext, perl=TRUE)
Success #stdin #stdout 0.21s 60752KB
stdin
Standard input is empty
stdout
[1] 1 2 3 4 5