stringi (version 0.2-5)

stri_locate: Locate Occurrences of a Pattern

Description

A convenience function. Calls either stri_locate_all, stri_locate_first, or stri_locate_last, depending on the argument used. Note that this is slower than the direct call.

Usage

stri_locate(str, ..., regex, fixed, coll, charclass, mode = c("first", "all",
  "last"))

Arguments

str
character vector of strings to search in
...
additional arguments passed to the underlying functions
regex
character vector; regular expressions
fixed
character vector; fixed patterns
coll
character vector; canonically equivalent patterns
charclass
character vector; identifiers of character classes
mode
single string; whether to look for all, or only the first/last occurrence of the pattern

Value

  • The return value is the same as that of the underlying functions called, i.e. a two-column matrix or a list of matrices.

Details

Unless you are very lazy, please call the underlying functions directly for better performance.

See Also

Other indexing: stri_locate_all_charclass, stri_locate_first_charclass, stri_locate_first_charclass, stri_locate_last_charclass, stri_locate_last_charclass; stri_locate_all_coll, stri_locate_first_coll, stri_locate_first_coll, stri_locate_last_coll, stri_locate_last_coll; 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_first_regex, stri_locate_first_regex, stri_locate_last_regex, stri_locate_last_regex; stri_locate_all; stri_locate_boundaries; stri_locate_first; stri_locate_last; stri_locate_words; stri_sub, stri_sub<-

Other search_locate: stri_locate_all_charclass, stri_locate_first_charclass, stri_locate_first_charclass, stri_locate_last_charclass, stri_locate_last_charclass; stri_locate_all_coll, stri_locate_first_coll, stri_locate_first_coll, stri_locate_last_coll, stri_locate_last_coll; 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_first_regex, stri_locate_first_regex, stri_locate_last_regex, stri_locate_last_regex; stri_locate_all; stri_locate_boundaries; stri_locate_first; stri_locate_last; stri_locate_words; stringi-search