From f2c96820c97765cf6759150f15f4a93aee33a772 Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Mon, 28 Oct 2024 13:52:38 +0100 Subject: [PATCH] Use `perl = TRUE` by default (#366) Closes #330 --- NEWS.md | 4 +++- R/helpers-pattern.R | 2 +- man/starts_with.Rd | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 621b496..66b6cc4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # tidyselect (development version) - + +* `matches()` now uses `perl = TRUE` by default. This makes it more consitent with regular expressions in stringr (#330). + * `eval_select()` and `eval_relocate()` gain a new `error_arg` argument that can be specified to throw a better error message when `allow_empty = FALSE` or `allow_rename = FALSE` (@olivroy, #327). * `vars_pull()` now also warns when using `.data` (#335). Please diff --git a/R/helpers-pattern.R b/R/helpers-pattern.R index 8ce0c26..dfcfb2f 100644 --- a/R/helpers-pattern.R +++ b/R/helpers-pattern.R @@ -144,7 +144,7 @@ contains <- function(match, #' @export matches <- function(match, ignore.case = TRUE, - perl = FALSE, + perl = TRUE, vars = NULL) { check_match(match) vars <- vars %||% peek_vars(fn = "matches") diff --git a/man/starts_with.Rd b/man/starts_with.Rd index 1dab344..2d8f751 100644 --- a/man/starts_with.Rd +++ b/man/starts_with.Rd @@ -14,7 +14,7 @@ ends_with(match, ignore.case = TRUE, vars = NULL) contains(match, ignore.case = TRUE, vars = NULL) -matches(match, ignore.case = TRUE, perl = FALSE, vars = NULL) +matches(match, ignore.case = TRUE, perl = TRUE, vars = NULL) num_range( prefix,