str
into substrings. A
pattern
indicates delimiters that separate the input
into fields. The input data between the matches become the
fields themselves.stri_split_regex(str, pattern, n_max = -1L, omit_empty = FALSE,
opts_regex = list())
stri_opts_regex
str
, pattern
, n_max
,
and omit_empty
.If n_max
is negative (default), then all pieces are
extracted.
omit_empty
is applied during splitting: if set to
TRUE
, then empty strings will never appear in the
resulting vector.
Note that if you want to split a string by characters from
a specific class (e.g. whitespaces),
stri_split_charclass
will be much faster.
stri_count_regex
;
stri_detect_regex
;
stri_extract_all_regex
,
stri_extract_all_regex
,
stri_extract_first_regex
,
stri_extract_first_regex
,
stri_extract_last_regex
,
stri_extract_last_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
;
stringi-search-regex
;
stringi-search
Other search_split: stri_split_charclass
,
stri_split_charclass
;
stri_split_fixed
,
stri_split_fixed
;
stri_split_lines
,
stri_split_lines
,
stri_split_lines1
,
stri_split_lines1
; stri_split
;
stringi-search
stri_split_regex("Lorem ipsum dolor sit amet",
"\\p{Z}+") # see also stri_split_charclass
Run the code above in your browser using DataLab