% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/detect_chars_structure.R
\name{detect_chars_structure}
\alias{detect_chars_structure}
\title{Detect character structure
Detect if values within a character variable match at least one of defined patterns}
\usage{
detect_chars_structure(vector, patterns, verbose = FALSE)
}
\arguments{
\item{vector}{Character. Input vector to detect pattern from}

\item{patterns}{Character. Patterns to detect within vector. Regex is supported}

\item{verbose}{Logical 1L. If TRUE, additional details related to the pattern detection are provided}
}
\value{
Logical 1L. If verbose is set to TRUE, the function returns a list with the following elements in order:
\itemize{
\item "Any defined structure" : Logical 1L. TRUE if the pattern is detected anywhere from the input vector
\item "Which" : Character. Unique values of input vector matching the defined patterns
\item "Where" : Integer. Indexes of values from input vector matching the defined patterns
}
}
\description{
Detect character structure
Detect if values within a character variable match at least one of defined patterns
}
\examples{
detect_chars_structure(
  vector = c("ABCD1234", "4567EF", "89GHIJ10"), 
  patterns = "[:alpha:]{4}" # detect four consecutive alphabetic values
)

detect_chars_structure(
  vector = c("ABCD1234", "4567EF", "89GHIJ10"), 
  patterns = "[:alpha:]{4}", 
  verbose = TRUE
)
}
