reconhub / linelist

An R package to import, clean, and store case data
https://www.repidemicsconsortium.org/linelist
Other
25 stars 5 forks source link

Regex boundaries #80

Closed zkamvar closed 5 years ago

zkamvar commented 5 years ago

This adds a default anchor_regex = TRUE, which will wrap the regular expressions in ^ and $ before processing:

linelist::clean_spelling(c("food", "foo"), data.frame(".regex foo", "bar"))
#> [1] "food" "bar"

linelist::clean_spelling(c("food", "foo"), data.frame(".regex foo", "bar"), anchor_regex = FALSE)
#> [1] "bard" "bar"

Created on 2019-05-31 by the reprex package (v0.3.0)