Refactor Zoekt search mode
Background
This is a follow-up to Backend work for regex mode toggle for Zoekt co... (#434417 - closed)
I was going to add regex:true/false
syntax to zoekt, but discovered that there's already regex:
syntax
Proposal
I believe that we should make search_mode
exact
/ regex
more robust.
Currently, if you search for foo case:yes
with the exact match mode, it doesn't work.
I think that we should split syntax from the rest of the search query:
- We extract all the syntax filters from the query
- Depending on the mode we put the query with double quotes or with
regex:
- We add all the filters to the end of the search query
- regex:
foo case:yes
->regex:foo case:yes
or keep it unchanged. - exact:
foo case:yes
->"foo" case:yes
Currently supported filters
case:
file:
f:
lang:
Edited by Dmitry Gruzd