re_match: Find regular expression matches

Description Usage Arguments Value Examples

Description

Return first or all regular expression matches

Usage

1
2
3
re_match(x, pat, perl = NULL, ...)

re_matches(x, pat, perl = NULL, ...)

Arguments

x

Input character vector

pat

Regular expression pattern/search string

perl

Logical indicating whether to use perl-style regex. If NULL (default) this checks for perl-style expressions.

...

Other arguments passed to regexpr or gregexpr

Value

A list containing character vector matches for each input

Examples

1
2
3
4
5
## find first match
re_match(c("AbC", "dEf"), "[A-Z]")

## find all matches
re_matches(c("AbC", "dEf"), "[A-Z]")

mkearney/myfirstpkg documentation built on May 9, 2019, 12:56 a.m.