Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement str_like() #280

Closed
hadley opened this issue Feb 8, 2019 · 3 comments · Fixed by #315
Closed

Implement str_like() #280

hadley opened this issue Feb 8, 2019 · 3 comments · Fixed by #315

Comments

@hadley
Copy link
Member

@hadley hadley commented Feb 8, 2019

Which follows the SQL LIKE definition

@quartin

This comment has been minimized.

Copy link

@quartin quartin commented Oct 31, 2019

I have been thinking a little bit about this, and though about the following implementation plan:

  • Add a like modifier - str_like default pattern type would be it;
  • Have a conversion method from SQL like-clauses to regex and so, under the hood, str_like would use stringr::str_subset

Problems I see here:

  • That second point being way harder than what I am imagining, lot's of hammering of edge cases in the conversion;
  • Possibility to generate an invalid regex and user sees a confusing error message (but i'm not using regex!).

Is this anything like what you would expect of this feature?

@hadley

This comment has been minimized.

Copy link
Member Author

@hadley hadley commented Oct 31, 2019

  • I was thinking a bit simpler than that — I was imagining just an equivalent of str_detect().

  • Yes, I was thinking of using regular expressions to convert like syntax to another regular expression; I think the syntax is simple enough that it's unlikely to cause too many problems.

@rjpat

This comment has been minimized.

Copy link
Contributor

@rjpat rjpat commented Nov 5, 2019

Created a PR for this #315 , open to any adjustments

@hadley hadley closed this in #315 Nov 11, 2019
hadley added a commit that referenced this issue Nov 11, 2019
Fixes #280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.