ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.

Home Page:http://geoff.greer.fm/ag/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ag incorrectly parses [.][^.]*$

fragmede opened this issue · comments

Hi,

ag incorrectly parses [.][^.]*$.

When I use ag, which uses pcre (note: not pcre2), vs ripgrep, which uses pcre2, I get:

fragmede@samairmac:~/projects/ag_bug$ find . | ag -o  [.][^.]*$ | sort -u  | tail -3
./the_silver_searcher/tests/word_regexp.t
./the_silver_searcher/the_silver_searcher.spec
./the_silver_searcher/the_silver_searcher.spec.in
fragmede@samairmac:~/projects/ag_bug$ find . | rg -o  [.][^.]*$ | sort -u  | tail -3
.w32
.yml
.zig
fragmede@samairmac:~/projects/ag_bug$

According to https://www.pcre.org/, pcre is older and unmaintained, so not sure what the best route going forward would be for ag. (Which I prefer over rg.)