Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

literal

Treat part of a regular expression literally


Description

Treats its contents as literal characters. Equivalent to using fixed = TRUE, but for part of the pattern rather than all of it.

Usage

literal(x)

Arguments

x

A character vector.

Value

A character vector representing part or all of a regular expression.

Examples

(rx <- digit(1, 3))
(rx_literal <- literal(rx))

# Usage
stringi::stri_detect_regex("123", rx)
stringi::stri_detect_regex("123", rx_literal)
stringi::stri_detect_regex("[[:digit:]]{1,3}", rx_literal)

rebus.base

Core Functionality for the 'rebus' Package

v0.0-3
Unlimited
Authors
Richard Cotton [aut, cre]
Initial release
2017-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.