# NOT RUN {
not(value = "FEB-28")
# construct expression
x <- start_of_line() %>%
find('FEB-29') %>%
not("FEB-28")
# create a string
string <- c("FEB-29-2017", "FEB-28-2017")
# extract matches, perl = TRUE is required for negative lookahead
regmatches(string, regexpr(x, string, perl = TRUE))
# another example
find(value = "q") %>%
not("u") %>%
grepl(x = c("qu", "qa", "qq", "q", "q u"), perl = TRUE)
# }
Run the code above in your browser using DataLab