fork(1) download
  1. x <- c(
  2. "The dog and the man play in the park.",
  3. "The man plays with the dog.",
  4. "That is the man's hat.",
  5. "Man I love that dog!",
  6. "I'm dog tired",
  7. "The dog park is no place for man.",
  8. "Park next to this dog's man."
  9. )
  10.  
  11. grepl("^(?!.*park)(?=.*dog.*man|.*man.*dog)", x, ignore.case=TRUE, perl=T)
  12. grepl("^(?!.*park)(?=.*dog)(?=.*man)", x, ignore.case=TRUE, perl=T)
  13.  
  14.  
Success #stdin #stdout 0.3s 22840KB
stdin
Standard input is empty
stdout
[1] FALSE  TRUE FALSE  TRUE FALSE FALSE FALSE
[1] FALSE  TRUE FALSE  TRUE FALSE FALSE FALSE