rx_one_or_more: Match the previous stuff one or more times.

Description Usage Arguments Examples

View source: R/loops.R

Description

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

Usage

1
rx_one_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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rx_one_or_more()

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

# create input
input <- "aaa"

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

RVerbalExpressions documentation built on Nov. 6, 2019, 5:08 p.m.