Description Usage Arguments Details Examples
View source: R/special_characters.R
Match a whitespace character.
1 | rx_whitespace(.data = NULL, inverse = FALSE)
|
.data |
Expression to append, typically pulled from the pipe |
inverse |
Invert match behavior, defaults to |
Match a whitespace character (one of space, tab, carriage return, new line, vertical tab and form feed).
carriage return: https://codepoints.net/U+000D
new line: https://codepoints.net/U+000
vertical tab: https://codepoints.net/U+000B
form feed: https://codepoints.net/U+000C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # match whitespace, default
rx_whitespace()
# dont match whitespace
rx_whitespace(inverse = TRUE)
# create an expression
x <- rx_whitespace()
# create input
string <- "1 apple"
# extract match
regmatches(string, regexpr(x, string))
# extract no whitespace by inverting behavior
y <- rx_whitespace(inverse = TRUE)
regmatches(string, gregexpr(y, string))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.