Skip to contents

Matches a given file with the regexes found in DR_FILE_REGEX and if there is a match, it returns the 'name' of that match.

Usage

match_regex(x, regexes = DR_FILE_REGEX)

Arguments

x

File to match.

regexes

Tibble with regex and function name.

Value

The function corresponding to the matching regex from DR_FILE_REGEX, or NA if there is no match made.

Examples

match_regex("foo.msi.json.gz")
#> [1] "TsoMsiFile"
match_regex("foo.fake.tsv")
#> [1] NA