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
Literal mode for string match
#9048
Comments
How is |
How would you find if |
That sounds like a case for a "literal" mode for |
Could you elaborate on what that might look like? |
Something like string match --literal foo foobar # checks if "foo" is anywhere in "foobar"
string match --literal --prefix foo foobar # checks if "foobar" starts with "foo"
string match --literal --suffix foo foobar # checks if it ends with "foo" or similar. In essence just like you would do That way the rest of the |
Oh I see what you're saying, if str2 actually already had glob characters in it, there is a problem. I was slow on the uptake there. |
string starts-with
and ends-with
string match
This is similar to how I wonder if |
I think
starts-with
andends-with
should be a standard inclusion in a set of string processing functions. Currently, I can usematches
but I have to do a regex escape on the start of the string, and it unnecessarily complicates what would otherwise be a very simple piece of code.The text was updated successfully, but these errors were encountered: