Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

rx_one_or_more: Match the previous stuff one or more times.

Description

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

Usage

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

Run this code
# NOT RUN {
rx_one_or_more()

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

# create input
input <- "aaa"

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

Run the code above in your browser using DataLab