match_pattern: Extract Strings by Regular Expression Quickly
Description
Given a pattern and a character vector, the function will extract
parts of these characters that match
the pattern. It is simply a wrapper of regmatches.
a character vector, each of its elements may or may not have parts that
match the specified pattern.
vec_result
should be TRUE or FALSE. If TRUE (default),
all matched parts will be returned in a character vector. If FALSE, a list is returned,
each element of the list represents the matching result of the corresponding element
in where. If an element in where has nothing matching the pattern, the result
is still an element in the list and assigned character(0).
perl
default is FALSE.
Should Perl-compatible regexps be used?
Value
a character vector or a list. If an element in where is NA, the result
corresponds to this element is character(0).