Search code examples
vimgrepag

Grep/Ack expression with parenthese and semicolon


I'm using vim Ag.vim from Silver Searcher. I would like to search let(:application in my project.

If I do :Ag "let(:application" app/ I get

|| ERR: Bad regex! pcre_compile() failed at position 16: missing )
|| If you meant to search for a literal string, run ag with -Q

No result with Ag -Q "let(:application" app/

Any idea of the right pattern ?


Solution

  • You can either escape the (:

    Ag 'let\(:application' app/
    

    Or use grep with -F for fixed strings:

    grep -F "let(:application" app/