Match a whitespace character.

whitespace(.data = NULL)

Arguments

.data

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

Details

Match a whitespace character (one of space, tab, carriage return, new line, vertical tab and form feed). This function is looks for tabs with the following expression: \d

  1. space: https://codepoints.net/U+0020

  2. tab: https://codepoints.net/U+0009

  3. carriage return: https://codepoints.net/U+000D

  4. new line: https://codepoints.net/U+000

  5. vertical tab: https://codepoints.net/U+000B

  6. form feed: https://codepoints.net/U+000C

Examples

whitespace()
#> [1] "\\s"
# create an expression x <- whitespace() # create input string <- "1 apple" # extract match regmatches(string, regexpr(x, string))
#> [1] " "