match_filenames: Match a set of regular expressions to a list of files

View source: R/utils.R

match_filenamesR Documentation

Match a set of regular expressions to a list of files

Description

Match a set of regular expressions to a list of files and return those filenames that comply to any of the provided regular expressions. This function basically wraps a grep to make it work on vectors by combining the vector of regex options as possible options.

Usage

match_filenames(file_list, regex_list)

Arguments

file_list

character vector. Haystack of filenames/filepaths.

regex_list

character vector. Needle of regular expressions to which filenames should comply.

Value

character vector. Subset of filenames from the file_list that comply to the provided regular expressions in regex_list.


adokter/birdRad documentation built on Nov. 5, 2024, 10:27 p.m.