stri_extract_fixed: Extract Fixed Pattern Matches

Description Usage Arguments Details Value See Also Examples

Description

These functions extract substrings of str that match a given pattern.

Usage

1
2
3
4
5
stri_extract_all_fixed(str, pattern, opts_collator = list())

stri_extract_first_fixed(str, pattern, opts_collator = list())

stri_extract_last_fixed(str, pattern, opts_collator = list())

Arguments

str

character vector

pattern

character vector

opts_collator

a named list as generated with stri_opts_collator with Collator options, or NA for fast but locale-unaware byte comparison

Details

Vectorized over str and pattern.

If collator_opts is not NA (default, i.e. locale-aware search), then the operation is not as dummy as it seems (for non-ASCII text).

Value

For stri_extract_all_fixed, a list of max(length(str), length(pattern)) character vectors is returned. Otherwise, you get a character vector. NA if not found.

See Also

Other search_extract: 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_regex, stri_extract_all_regex, stri_extract_first_regex, stri_extract_first_regex, stri_extract_last_regex, stri_extract_last_regex; stri_extract_all; stri_extract_first; stri_extract_last; stri_extract; stringi-search

Other search_fixed: stri_count_fixed; stri_detect_fixed; stri_locate_all_fixed, stri_locate_all_fixed,, stri_locate_first_fixed, stri_locate_first_fixed,, stri_locate_last_fixed, stri_locate_last_fixed; stri_opts_collator; stri_replace_all_fixed, stri_replace_all_fixed, stri_replace_first_fixed, stri_replace_first_fixed, stri_replace_last_fixed, stri_replace_last_fixed; stri_split_fixed, stri_split_fixed; stringi-search-fixed; stringi-search

Other search_locate: stri_locate_all_charclass, stri_locate_all_charclass, stri_locate_first_charclass, stri_locate_first_charclass, stri_locate_last_charclass, stri_locate_last_charclass; stri_locate_all_fixed, stri_locate_all_fixed,, stri_locate_first_fixed, stri_locate_first_fixed,, stri_locate_last_fixed, stri_locate_last_fixed; 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_locate_all; stri_locate_first; stri_locate_last; stri_locate; stringi-search

Examples

1
2
3
4
5
6
## Not run: 
stri_extract_all_fixed(c('AaaaaaaA', 'AAAA'), 'a')
stri_extract_first_fixed(c('Yy\u00FD', 'AAA'), 'y', stri_opts_collator(strength=2, locale="sk_SK"))
stri_extract_last_fixed(c('Yy\u00FD', 'AAA'), 'y', stri_opts_collator(strength=1, locale="sk_SK"))

## End(Not run)

Example output

[[1]]
[1] "a" "a" "a" "a" "a" "a"

[[2]]
[1] NA

[1] "y" NA 
[1] "y" NA 

stringi documentation built on May 2, 2019, 4:54 p.m.