R/wfs_wild.R

Defines functions wfs_wild

# Expand a pattern using wildcards ? and *
#
wfs_wild <- function(pattern, map) {
  pattern <- stringr::str_replace_all(pattern, "[?]", "[0-9a-z]")
  pattern <- stringr::str_replace_all(pattern, "[*]", "[0-9a-z]*")
  map[stringr::str_detect(names(map), pattern)]
}
grodri/wfs documentation built on July 16, 2020, 11:11 p.m.