Learn R Programming

RVerbalExpressions (version 0.1.1)

rx_seek_prefix: Positive lookaround functions

Description

This function facilitates matching by providing assurances for surrounding symbols/groups of symbols. It allows for building expressions that are dependent on context of occurrence.

Usage

rx_seek_prefix(.data = NULL, value)

rx_seek_suffix(.data = NULL, value)

Arguments

.data

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

value

Exact expression to match

Examples

Run this code
# this will match anything between square brackets
rx() %>%
  rx_seek_prefix("[") %>%
  rx_anything("lazy") %>%
  rx_seek_suffix(']')

Run the code above in your browser using DataLab