util_extract_matches function

return all matches of an expression

return all matches of an expression

util_extract_matches(data, pattern)

Arguments

  • data: a character vector
  • pattern: a character string containing a regular expression

Returns

A list with matching elements or NULL (in case on non-matching elements)

Examples

## Not run: # not exported, so not tested dat0 <- list("a sentence with citation (Ref. 12), (Ref. 13), and then (Ref. 14)", "another sentence without reference") pat <- "Ref. (\\d+)" util_extract_matches(dat0, pat) ## End(Not run)

See Also

Stack Overflow

Other process_functions: util_abbreviate(), util_all_is_integer(), util_attach_attr(), util_bQuote(), util_backtickQuote(), util_coord_flip(), util_par_pmap(), util_setup_rstudio_job(), util_suppress_output()

Author(s)

Josh O'Brien

  • Maintainer: Stephan Struckmann
  • License: BSD_2_clause + file LICENSE
  • Last published: 2025-03-05