-
Notifications
You must be signed in to change notification settings - Fork 582
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
Add a 'use string literally' search option #186
Comments
Probably straight forward to add a "quotemeta" option and pass the query to https://golang.org/pkg/regexp/#QuoteMeta if present. |
Use case: Cutting and pasting part or all of a line of code to search for it seems like a common operation, and since code frequently will contain characters that are special in regex terms, currently I find I need to edit the line after pasting instead of just cut/paste/search. The number of times I need to do a regex search for code has been relatively low, but an additional click or key press on top of typing in a regex for code seems like a very small increase in input for that use case compared to the cut/paste/search. I think it would be useful to be able to make this the default through the UI, with the option to switch the search to regexp/plain depending on the site default, and leave it up to site admins to determine based on usage which is most useful default for their users. |
For me its so low its almost never. The only time I think I've ever tried a regex for code searching was trying to count LOC using Visual Studio's find tool (it didnt work anyway). I'm searching code to find usages, so I already know the identifier. Literal should be the default. |
It would also be much more intuitive if whitespace was treated as |
Sometimes I want to search for some code that contains regexp metacharacters, e.g. I want to search
foo.baz[bar]()
. It would be nice to have an option in the UI to do this -- I find it takes some thought to work out it'sfoo\.baz\[bar\]\(\)
.The text was updated successfully, but these errors were encountered: