Description Usage Arguments Details Value See Also Examples
This function counts the number of occurrences of matches to a regex pattern.
1 | stri_count_regex(str, pattern, opts_regex = list())
|
str |
character vector of strings to search in |
pattern |
character vector of regular expressions |
opts_regex |
a named list as generated with
|
Vectorized over str
and pattern
.
If pattern
is empty, then the result is NA
and a warning is generated.
Returns an integer vector.
Other search_count: stri_count_charclass
;
stri_count_fixed
; stri_count
;
stringi-search
Other search_regex: stri_detect_regex
;
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_locate_all_regex
,
stri_locate_all_regex
,
stri_locate_first_regex
,
stri_locate_first_regex
,
stri_locate_last_regex
,
stri_locate_last_regex
;
stri_match_all_regex
,
stri_match_all_regex
,
stri_match_first_regex
,
stri_match_first_regex
,
stri_match_last_regex
,
stri_match_last_regex
;
stri_opts_regex
;
stri_replace_all_regex
,
stri_replace_all_regex
,
stri_replace_first_regex
,
stri_replace_first_regex
,
stri_replace_last_regex
,
stri_replace_last_regex
;
stri_split_regex
,
stri_split_regex
;
stringi-search-regex
;
stringi-search
1 2 3 4 5 6 7 8 9 10 | ## Not run:
s <- "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
stri_count_regex(s,"(s|el)it")
stri_count_regex(s,"i.i")
stri_count_regex(s,".it")
stri_count_regex("bab baab baaab",c("b.*?b","b.b"))
stri_count_regex(c("stringi w R","REXAMINE","123"), '( R|RE)')
stri_count_regex(c("stringi w R","REXAMINE","123"), '(i|I|1)')
## End(Not run)
|
[1] 2
[1] 2
[1] 2
[1] 3 2
[1] 1 1 0
[1] 2 1 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.