Learn R Programming

stringi (version 0.1-25)

stri_extract_last: Extract Last Pattern Match

Description

A convenience function. Calls either stri_extract_last_regex, stri_extract_last_fixed, or stri_extract_last_charclass, depending on the argument used.

Usage

stri_extract_last(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

Value

  • Returns a character vector.

Details

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

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_fixed, stri_extract_all_fixed,, stri_extract_first_fixed, stri_extract_first_fixed,, stri_extract_last_fixed, stri_extract_last_fixed; 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; stringi-search

Examples

Run this code
s <- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
stri_extract_last('XaaaaX', regex=c('\\p{Ll}', '\\p{Ll}+', '\\p{Ll}{2,3}', '\\p{Ll}{2,3}?'))
stri_extract_last('Bartolini', fixed=letters[1:3])
stri_extract_last(s, charclass='Zs')

Run the code above in your browser using DataLab