Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

start_of_line: Match the expression only if it appears from beginning of line.

Description

Control whether to match the expression only if it appears from the beginning of the line.

Usage

start_of_line(enable = TRUE)

Arguments

enable

Whether to enable this behavior, defaults to TRUE

Examples

Run this code
# NOT RUN {
start_of_line(enable = TRUE)
start_of_line(enable = FALSE)

# create expression
x <- start_of_line() %>%
  find("apple")

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

Run the code above in your browser using DataLab