pattern
.stri_replace_all_charclass(str, pattern, replacement, merge = FALSE)stri_replace_first_charclass(str, pattern, replacement)
stri_replace_last_charclass(str, pattern, replacement)
stri_replace_all_charclass
only];
should consecutive matches be merged into a single one?str
, pattern
, and replacement
.These functions scan the input string for matches of a character class. Input that is not part of any match is left unchanged; each match is replaced in the result by the same (fixed) replacement string.
stri_count_charclass
;
stri_detect_charclass
;
stri_extract_all_charclass
,
stri_extract_first_charclass
,
stri_extract_first_charclass
,
stri_extract_last_charclass
,
stri_extract_last_charclass
;
stri_locate_all_charclass
,
stri_locate_first_charclass
,
stri_locate_first_charclass
,
stri_locate_last_charclass
,
stri_locate_last_charclass
;
stri_split_charclass
;
stri_trim
, stri_trim
,
stri_trim_both
,
stri_trim_left
,
stri_trim_right
;
stringi-search-charclass
;
stringi-search
Other search_replace: stri_replace_all_coll
,
stri_replace_first_coll
,
stri_replace_first_coll
,
stri_replace_last_coll
,
stri_replace_last_coll
;
stri_replace_all_fixed
,
stri_replace_first_fixed
,
stri_replace_first_fixed
,
stri_replace_last_fixed
,
stri_replace_last_fixed
;
stri_replace_all_regex
,
stri_replace_first_regex
,
stri_replace_first_regex
,
stri_replace_last_regex
,
stri_replace_last_regex
;
stri_replace_all
;
stri_replace_first
;
stri_replace_last
;
stri_replace_na
;
stri_replace
; stringi-search
stri_replace_all_charclass("a\nb\tc d", "\\p{WHITE_SPACE}", "")
stri_replace_all_charclass("a\nb\tc d", "\\p{WHITE_SPACE}", "", TRUE)
Run the code above in your browser using DataLab