Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

rx_find: Match an expression.

Description

Identify a specific pattern exactly.

Usage

rx_find(.data = NULL, value)

Arguments

.data

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

value

Exact expression to match

References

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

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

Examples

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

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

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

# }

Run the code above in your browser using DataLab