Learn R Programming

rebus.base (version 0.0-3)

recursive: Make the regular expression recursive.

Description

Makes the regular expression (or part of it) recursive.

Usage

recursive(x)

Arguments

x
A character vector.

Value

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

References

http://www.regular-expressions.info/recurse.html and http://www.rexegg.com/regex-recursion.html

Examples

Run this code
recursive("a")

# Recursion isn't supported by R's PRCE engine or
# stringi/stringr's ICU engine
x <- c("ab222z", "ababz", "ab", "abab")
rx <- "ab(?R)?z"
grepl(rx, x, perl = TRUE)
try(grepl(rx, x))
try(stringi::stri_detect_regex(x, rx))

Run the code above in your browser using DataLab