stri_locate_all: Locate All Occurrences of a Pattern

Description Usage Arguments Details Value See Also Examples

Description

A convenience function. Calls either stri_locate_all_regex, stri_locate_all_fixed, or stri_locate_all_charclass, depending on the argument used.

Usage

1
stri_locate_all(str, ..., regex, fixed, charclass)

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

charclass

character vector; identifiers of character classes

Details

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

Please note that the parameters are considered in the following order: regex, fixed and class. Thus, if you specify regex and class, only the first one will be used.

Value

Returns a list of integer matrices. The first column gives the start positions of the matches, and the second one gives the end position. Double NAs iff not found or NA argument is given.

See Also

Other indexing: 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_first; stri_locate_last; stri_locate; stri_sub, stri_sub<-

Other search_locate: 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_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_first; stri_locate_last; stri_locate; stringi-search

Examples

1
2
3
4
5
6
7
## Not run: 
stri_locate_all('XaaaaX',
   regex=c('\\p{Ll}', '\\p{Ll}+', '\\p{Ll}{2,3}', '\\p{Ll}{2,3}?'))
stri_locate_all('Bartolini', fixed='i')
stri_locate_all('a b c', charclass='Zs') # all white spaces

## End(Not run)

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