tidyverse / stringr

A fresh approach to string manipulation in R
https://stringr.tidyverse.org
Other
603 stars 187 forks source link

SQL's LIKE is actually case sensitive #543

Closed hadley closed 1 month ago

hadley commented 6 months ago

So need to change the default, and update the docs.

Probably worth a little exploration of impact on users (with github search for str_like()).

edward-burn commented 6 months ago

@hadley I wonder whether instead of changing the default of ignore_case, what about introducing a new function: str_ilike()?

Then stringr could have two functions

I suppose the benefit of this would be that these would more directly align with SQL concepts. But the drawback would be this would be a bigger change (although perhaps a less subtle breaking change than simply switching the default)

hadley commented 6 months ago

Yeah, I think that's a good idea. Then we can just deprecate the ignore_case argument.

OTOH it's not very consistent with how other stringr handle case. But I think it's justifiable in this case because it's so closely related to mimicing SQL.

edward-burn commented 6 months ago

@hadley I have opened pr #544 with a str_ilike function and the ignore_case argument in str_like deprecated

hadley commented 5 months ago

Thanks, I'll take a look when I'm next working on stringr.