File: str_escape.Rd

package info (click to toggle)
r-cran-stringr 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,032 kB
  • sloc: javascript: 11; sh: 9; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/escape.R
\name{str_escape}
\alias{str_escape}
\title{Escape regular expression metacharacters}
\usage{
str_escape(string)
}
\arguments{
\item{string}{Input vector. Either a character vector, or something
coercible to one.}
}
\value{
A character vector the same length as \code{string}.
}
\description{
This function escapes metacharacter, the characters that have special
meaning to the regular expression engine. In most cases you are better
off using \code{\link[=fixed]{fixed()}} since it is faster, but \code{str_escape()} is useful
if you are composing user provided strings into a pattern.
}
\examples{
str_detect(c("a", "."), ".")
str_detect(c("a", "."), str_escape("."))
}