
str
that match
a given pattern
.See also stri_match_all_regex
for extracting
matches together with regex capture groups.
stri_extract_all_regex(str, pattern, opts_regex = list())stri_extract_first_regex(str, pattern, opts_regex = list())
stri_extract_last_regex(str, pattern, opts_regex = list())
stri_opts_regex
stri_extract_all_regex
, list of
max(length(str), length(pattern))
character vectors
is returned. Otherwise, you get a character vector.
NA
if not found.str
and pattern
.stri_extract_all_charclass
,
stri_extract_all_charclass
,
stri_extract_first_charclass
,
stri_extract_first_charclass
,
stri_extract_last_charclass
,
stri_extract_last_charclass
;
stri_extract_all_fixed
,
stri_extract_all_fixed,
,
stri_extract_first_fixed
,
stri_extract_first_fixed,
,
stri_extract_last_fixed
,
stri_extract_last_fixed
;
stri_extract_all
;
stri_extract_first
;
stri_extract_last
;
stri_extract
; stringi-search
Other search_regex: stri_count_regex
;
stri_detect_regex
;
stri_locate_all_regex
,
stri_locate_all_regex
,
stri_locate_first_regex
,
stri_locate_first_regex
,
stri_locate_last_regex
,
stri_locate_last_regex
;
stri_match_all_regex
,
stri_match_all_regex
,
stri_match_first_regex
,
stri_match_first_regex
,
stri_match_last_regex
,
stri_match_last_regex
;
stri_opts_regex
;
stri_replace_all_regex
,
stri_replace_all_regex
,
stri_replace_first_regex
,
stri_replace_first_regex
,
stri_replace_last_regex
,
stri_replace_last_regex
;
stri_split_regex
,
stri_split_regex
;
stringi-search-regex
;
stringi-search
stri_extract_all_regex('XaaaaX', c('\\p{Ll}', '\\p{Ll}+', '\\p{Ll}{2,3}', '\\p{Ll}{2,3}?'))
stri_extract_first_regex('XaaaaX', c('\\p{Ll}', '\\p{Ll}+', '\\p{Ll}{2,3}', '\\p{Ll}{2,3}?'))
stri_extract_last_regex('XaaaaX', c('\\p{Ll}', '\\p{Ll}+', '\\p{Ll}{2,3}', '\\p{Ll}{2,3}?'))
Run the code above in your browser using DataLab