hadley
released this
stringr 1.2.0
API changes
str_match_all()
now returns NA if an optional group doesn't match
(previously it returned ""). This is more consistent withstr_match()
and other match failures (#134).
New features
- In
str_replace()
,replacement
can now be a function that is called once
for each match and who's return value is used to replace the match. - New
str_which()
mimicsgrep()
(#129). - A new vignette (
vignette("regular-expressions")
) describes the
details of the regular expressions supported by stringr.
The main vignette (vignette("stringr")
) has been updated to
give a high-level overview of the package.
Minor improvements and bug fixes
str_order()
andstr_sort()
gain explicitnumeric
argument for sorting
mixed numbers and strings.str_replace_all()
now throws an error ifreplacement
is not a character
vector. Ifreplacement
isNA_character_
it replaces the complete string
with replaces withNA
(#124).- All functions that take a locale (e.g.
str_to_lower()
andstr_sort()
)
default to "en" (English) to ensure that the default is consistent across
platforms.