API changes

This release includes a change to the API: str_match_all() now returns NA if an optional group doesn’t match (previously it returned “”). This is more consistent with str_match() and other match failures.

New features

There are three new features:

Minor improvements and bug fixes

There were three other minor improvements and bug fixes:

  • str_order() and str_sort() gain explicit numeric argument for sorting mixed numbers and strings.

  • str_replace_all() now throws an error if replacement is not a character vector. If replacement is NA_character_ it replaces the complete string with NA.

  • All functions that take a locale (e.g. str_to_lower() and str_sort()) default to “en” (English) to ensure that the default is consistent across platforms.