% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preProcess.R
\name{.expandAlsoExtractPatterns}
\alias{.expandAlsoExtractPatterns}
\title{Expand regex patterns in \code{alsoExtract} against a known list of archive files.}
\usage{
.expandAlsoExtractPatterns(alsoExtract, filesInArchive)
}
\arguments{
\item{alsoExtract}{Character vector (or \code{NULL}).}

\item{filesInArchive}{Character vector of files inside the archive, as
returned by \code{makeRelative(.listFilesInArchive(archive), destinationPath)}.}
}
\value{
A character vector with pattern elements replaced by their matches.
}
\description{
For each element of \code{alsoExtract} that is not a literal match in
\code{filesInArchive} (by relative path or basename), the element is treated as a
regular expression and \code{grep()}-ed against \code{filesInArchive}.  Matched names
replace the pattern; unmatched patterns are kept as-is so that downstream
code can emit a useful "file not found" error.  Special sentinel values
(\code{"similar"}, \code{"none"}, \code{NA}) are passed through unchanged.
}
\details{
This lets users write e.g.
\code{alsoExtract = "CMD_sm|CMD_sp"} to select all archive members whose name
contains \code{CMD_sm} or \code{CMD_sp}.
}
\keyword{internal}
