Description Usage Arguments Details Value See Also Examples
Helper function to collect partial (or complete) matches of (Perl-compatible) regular expressions.
1 | match_parts(x, pattern, ignore.case = FALSE)
|
x |
Character vector. If it has names, these names will be used as row names or vector names in the output. |
pattern |
Character scalar with regular expression that defines one to several capturing groups (partial matches) in parentheses. If they are named, these names will be used as column names in the output. Alternatively, if no capturing groups are present and thus no partial matches occur, the complete matches are returned as vector. |
ignore.case |
Logical scalar passed to
|
For discarding regular expression groups in the output,
use non-capturing groups such as (?:left|right)
.
If capturing groups are used, a matrix of mode
‘character’ with the number of rows equal to the
length of x
and one column per capturing group. If
these were named, their names appear as column names. If
no capturing groups were present, a character vector of
the same length as x
is returned, containing the
complete matches, if any. Non-matches are always
represented as NA
.
base::regmatches
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.