regex_match: Regular expression matches

View source: R/regex_match.R

regex_matchR Documentation

Regular expression matches

Description

Returns elements of a character vector that match the given regular expression

Usage

regex_match(regex = NULL, vector = NULL, silent = FALSE, perl = FALSE)

Arguments

regex

a regular expression provided, a default theme will be used.

vector

a character vector in which to search for regular expression matches, or a data table whose column names will be searched

silent

logical. If silent = FALSE, a report on regular expression matches will be printed. If silent = TRUE, the report on regular expression matches will not be printed. By default, silent = FALSE

perl

logical. Should Perl-compatible regexps be used?

Examples

regex_match("p$", names(mtcars))

colnames_ending_with_p <- regex_match("p$", names(mtcars))


kim documentation built on Oct. 9, 2023, 5:08 p.m.