rx_space: Match a space character.

Description Usage Arguments Examples

View source: R/special_characters.R

Description

Matches a space character.

Usage

1
rx_space(.data = NULL, inverse = FALSE)

Arguments

.data

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

inverse

Invert match behavior, defaults to FALSE (match space). Use TRUE to not match space.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# match space, default
rx_space()

# dont match space
rx_space(inverse = TRUE)

# create an expression
x <- rx_space()

# create input
string <- "1 apple\t"

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

# extract no whitespace by inverting behavior
y <- rx_space(inverse = TRUE)
regmatches(string, gregexpr(y, string))

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