rx_none_or_more: Match the previous stuff zero or many times.

View source: R/loops.R

rx_none_or_moreR Documentation

Match the previous stuff zero or many times.

Description

This function simply adds a * to the end of the expression.

Usage

rx_none_or_more(.data = NULL, mode = "greedy")

Arguments

.data

Expression to append, typically pulled from the pipe %>%

mode

Matching mode (greedy (default) orlazy). Lazy matching stops after the first match, greedy continues searching until end of the string and then back-tracks to the last match.

Examples

rx_none_or_more()

# create an expression
x <- rx() %>%
  rx_find("a") %>%
  rx_none_or_more()

# create input
input <- "aaa"

# extract match
regmatches(input, regexpr(x, input))

VerbalExpressions/RVerbalExpressions documentation built on March 27, 2024, 8:20 a.m.