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

View source: R/rules.R

rx_start_of_lineR Documentation

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

rx_start_of_line(.data = NULL, enable = TRUE)

Arguments

.data

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

enable

Whether to enable this behavior, defaults to TRUE

Examples

rx_start_of_line(enable = TRUE)
rx_start_of_line(enable = FALSE)

# create expression
x <- rx() %>%
  rx_start_of_line() %>%
  rx_find("apple")

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

VerbalExpressions/RVerbalExpressions documentation built on March 27, 2024, 8:20 a.m.