% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/character.r
\name{grepv-wrappers}
\alias{grepv-wrappers}
\alias{grepv}
\alias{grepvf}
\alias{grepvi}
\title{Pattern Matching}
\usage{
grepv(
  pattern,
  x,
  ignore.case = FALSE,
  perl = FALSE,
  value = TRUE,
  fixed = FALSE,
  useBytes = FALSE,
  invert = FALSE
)

grepvf(pattern, x, useBytes = FALSE, invert = FALSE)

grepvi(pattern, x, perl = FALSE, useBytes = FALSE, invert = FALSE)
}
\arguments{
\item{pattern}{character string containing a regular expression (or character string
for \code{fixed = TRUE} to be matched in the given character vector.
Coerced by \link{as.character} to a character string if possible.
If a character vector of length \code{2} or more is supplied, the first
element is used with a warning. Missing values are allowed.}

\item{x}{a character vector where matches are sought, or an object
which can be coerced by \link{as.character} to a character vector.
Long vectors are supported.}

\item{ignore.case}{logical. if \code{FALSE}, the pattern matching is case sensitive
and if \code{TRUE}, case is ignored during matching.}

\item{perl}{logical. Should Perl-compatible regexps be used?}

\item{value}{logical. If \code{FALSE}, a vector containing the (integer) indices of
the matches determined by grep is returned, and if \code{TRUE}, a vector
containing the matching elements themselves is returned.}

\item{fixed}{logical. If \code{TRUE}, pattern is a string to be matched as is.
Overrides all conflicting arguments.}

\item{useBytes}{logical. If \code{TRUE} the matching is done byte-by-byte rather
than character-by-character.}

\item{invert}{logical. If \code{TRUE} return indices or values for elements that
do not match.}
}
\value{
character vector containing the selected elements of \code{x}
(after coercion, preserving names but no other attributes).

\code{grepv()} can also return a vector of the indices of the
elements of \code{x} that yielded a match (or not, for
\code{invert = TRUE}) if \code{value = FALSE} (see note). This will
be an integer vector unless the input is a long vector,
when it will be a double vector.
}
\description{
Strongly typed wrappers around \code{\link{grep}} that have the
\code{value} (see note), \code{ignore.case} and \code{fixed} arguments
set internally (as well as the conflicting arguments).

If \code{grepv} is found in the current \strong{R} version, it is
reexported from base.
}
\details{
\verb{*f()} suffixed functions have \code{fixed = TRUE} and conflicting
arguments (\code{perl} and \code{ignore.case}) set as \code{FALSE}.

\verb{*i()} suffixed functions have \code{ignore.case = TRUE} and the
conflicting \code{fixed} argument set as \code{FALSE}.

For full documentation of the wrapped functions, see the help
pages for \code{\link{grep}}.
}
\note{
suppr wrappers of the base grep/sub functions remove the
arguments that relate to the strong typing, just like
\code{grepl} does by not having a \code{value} argument. However,
the base \code{grepv} implementation has kept the \code{value}
argument, so the version here keeps the \code{value} argument
for compatibility.
}
\examples{
grepv("foo", c("foo", "Foo", "bar"))
grepvf("foo", c("foo", "Foo", "bar"))
grepvi("foo", c("foo", "Foo", "bar"))
}
\seealso{
Other pattern-match-replacement-wrappers:
\code{\link{grep-wrappers}},
\code{\link{grepl-wrappers}},
\code{\link{sub-wrappers}}
}
\concept{pattern-match-replacement-wrappers}
