Description Usage Arguments Value Examples
Extract submatches from strings
1 |
pattern |
An extended regular expression (see regex) including at least one parenthesized subexpression |
xs |
Character vector with strings from which to extract the subexpressions matched by ‘pattern’ |
drop |
If TRUE instead of returning a single-column or single-row matrix a vector is returned |
Returns a matrix containing submatches extracted from ‘xs’ according to ‘pattern’. The entry in row i and column j corresponds to the jth submatch extracted from ‘x[i]’. If ‘pattern’ did not match an element of ‘xs’, the corresponding row in the returned matrix will consist entirely of NA_character_ values. If ‘drop = TRUE’ single-column and single-row matrices are returned as vectors.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.