Consider the following example:
> testLines <- c(\"I don\'t want to match this\",\"This is what I want to match\") > grepl(\'is\',testLines) > [
"\<" is another escape sequence for the beginning of a word, and "\>" is the end. In R strings you need to double the backslashes, so:
> grepl("\\", c("this", "who is it?", "is it?", "it is!", "iso")) [1] FALSE TRUE TRUE TRUE FALSE
Note that this matches "is!" but not "iso".