Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

find: Match an expression.

Description

This expression uses a non capturing group to identify a specific pattern exactly.

Usage

find(.data = NULL, value)

Arguments

.data

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

value

Exact expression to match

References

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

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

Examples

Run this code
# NOT RUN {
find(value = "apple")

# create expression
x <- find(value = "apples")

grepl(x, "apple")  # should be false
grepl(x, "apples") # should be true

# }

Run the code above in your browser using DataLab