stringi (version 0.2-5)

stri_detect_fixed: Detect a Fixed Pattern Match

Description

This function checks if there is at least one occurrence of a fixed pattern in a string.

Usage

stri_detect_fixed(str, pattern)

Arguments

str
character vector
pattern
character vector

Value

  • Returns a logical vector.

Details

Vectorized over str and pattern.

For natural language processing this function may be not give you desired results. Refer to stringi-search-fixed for more details.

If pattern is empty, then the result is NA and a warning is generated.

See Also

Other search_detect: stri_detect_charclass; stri_detect_coll; stri_detect_regex; stri_detect; stringi-search

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

Examples

Run this code
if (stri_install_check(silent=TRUE))
stri_detect_fixed(c("stringi R", "REXAMINE", "123"), c('i', 'R', '0'))

if (stri_install_check(silent=TRUE))
stri_detect_fixed(c("stringi R", "REXAMINE", "123"), 'R')

Run the code above in your browser using DataLab