This expression uses a non capturing group to identify a specific pattern when you do not need the group to capture its match. Alias for then. Meant for semantics when used at the beginning of a verbal expression. For example, find(value = 'foo') is more readable than then(value = 'foo').

find(.data = NULL, value)

Arguments

.data

Expression to append, typically pulled from the pipe %>%

value

Expression to match

References

Non capturing group: https://www.regular-expressions.info/brackets.html

Stack Overflow: https://stackoverflow.com/questions/3512471

Examples

find(value = "apple")
#> [1] "(?:apple)"
# create expression x <- start_of_line() %>% find("apple") %>% end_of_line() grepl(x, "apples") # should be false
#> [1] FALSE
grepl(x, "apple") # should be true
#> [1] TRUE