R/rules.R
rx_start_of_line.Rd
Control whether to match the expression only if it appears from the beginning of the line.
rx_start_of_line(.data = NULL, enable = TRUE)
.data | Expression to append, typically pulled from the pipe |
---|---|
enable | Whether to enable this behavior, defaults to |
rx_start_of_line(enable = TRUE)#> [1] "^"rx_start_of_line(enable = FALSE)#> NULL# create expression x <- rx() %>% rx_start_of_line() %>% rx_find("apple") grepl(x, "pineapple") # should be false#> [1] FALSE#> [1] TRUE