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

Combine contains and ismatch? #19250

Closed
simonbyrne opened this issue Nov 7, 2016 · 5 comments
Closed

Combine contains and ismatch? #19250

simonbyrne opened this issue Nov 7, 2016 · 5 comments
Labels
domain:search & find The find* family of functions domain:strings "Strings!"

Comments

@simonbyrne
Copy link
Contributor

simonbyrne commented Nov 7, 2016

ismatch and contains do basically the same thing, except the first takes a regex pattern, the second a string pattern, and the argument order is switched.

Can we combine them, and if so, which one should we keep?

@simonbyrne simonbyrne added the domain:strings "Strings!" label Nov 7, 2016
@simonster
Copy link
Member

See also #10593

@simonbyrne
Copy link
Contributor Author

simonbyrne commented Nov 7, 2016

(let's try a vote by thumbs up)

contains

  • matches the argument order of replace (which already accepts both regexes and strings)

@simonbyrne
Copy link
Contributor Author

ismatch

  • begins with is (making it easy to find by tab completion)
  • matches the argument order of match

@dhoegh
Copy link
Contributor

dhoegh commented Nov 7, 2016

See also discussion in #18028.

@KristofferC
Copy link
Sponsor Member

Closed by #24673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:search & find The find* family of functions domain:strings "Strings!"
Projects
None yet
Development

No branches or pull requests

5 participants