Count matching indices in character vector
Arguments
- strings
A character vector, where each element of the vector is a character string.
- pattern
A single character string to be searched for in each element of
strings
. By default,pattern
is interpreted as a regular expression (regex). If thefixed
argument is set toTRUE
,pattern
will be treated as a literal string to be matched exactly.- fixed
Logical; whether
pattern
should be matched exactly, treating regex special characters as regular string characters. DefaultFALSE
.
Details
These functions are built using the base R regular expression functions.
{suitestrings}
uses Perl-compatible Regular Expressions (PCRE).
This is achieved by setting perl = TRUE
in the underlying base functions.
See R's regexp documentation for info on the regex implementation.
For complete syntax details see https://www.pcre.org/current/doc/html/