Detect and return all matching patterns from character vector.

Detect and return first matching pattern from character vector.

chr_extract(x, pat, = FALSE, collapse = NULL,
  invert = FALSE, na = TRUE, ...)

chr_extract_first(x, pat, = FALSE, invert = FALSE,
  na = TRUE, ...)

chr_extract_links(x, collapse = NULL)

chr_extract_words(x, collapse = NULL)

chr_extract_mentions(x, collapse = NULL)

chr_extract_hashtags(x, collapse = NULL)

chr_extract_phone(x, collapse = NULL)



Character vector


Pattern (regex) to extract from text.

Logical indicating whether to ignore capitalization. Defaults to false.


Text inserted between extracted matches. If non-null (the default) a vector of matches is returned for each inputted string.


Logical indicating whether to extract matching portion (default) or, if this value is true, non-matching portions of text.


Logical indicating whether to return NA values for input elements without matches. Defaults to true.


Other named arguments passed to gregexpr.


Vector of matches extracted from input text.

Character vector of matches extracted from input text.