Try
txt[- grepl(pattern, txt)]
txt[! grepl(pattern, txt)]
On Mon, Jun 22, 2009 at 5:45 PM, orzack wrote:
> Does anybody know how to negate a string in a grep command, i.e., what I
> need is to return only strings that do NOT contain a second string anywhere
> in the entire string.
>
>
> for
You can try somthing about like this:
setdiff(txt, grep("(oob|boo|\\w[^oo]\\w)", txt, value = TRUE))
On Mon, Jun 22, 2009 at 6:45 PM, orzack wrote:
> Does anybody know how to negate a string in a grep command, i.e., what I
> need is to return only strings that do NOT contain a second string an
Does anybody know how to negate a string in a grep command, i.e.,
what I need is to return only strings that do NOT contain a second
string anywhere in the entire string.
for
txt <- c("boo","goo","doob","foo","boofoo")
I need a grep command that returns strings with "oo" except when "b"
is
3 matches
Mail list logo