Skip to content
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

pcre2 incorrectly parses [.][^.]*$. #280

Closed
fragmede opened this issue Aug 8, 2023 · 3 comments
Closed

pcre2 incorrectly parses [.][^.]*$. #280

fragmede opened this issue Aug 8, 2023 · 3 comments

Comments

@fragmede
Copy link

fragmede commented Aug 8, 2023

Hi,

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

When I use ag, which uses pcre2, vs ripgrep, which uses rust's implementation of regexp, 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$
@BurntSushi
Copy link

Looks like it could be an ag bug? If you tell ripgrep to use PCRE2, then it gets the same result:

$ git remote -v
origin  git@github.com:ggreer/the_silver_searcher (fetch)
origin  git@github.com:ggreer/the_silver_searcher (push)
$ git rev-parse HEAD
a61f1780b64266587e7bc30f0f5f71c6cca97c0f
$ find . | rg -P -o [.][^.]*$ | sort -u | tail -3
.txt
.w32
.yml

Note also that ag uses PCRE, not PCRE2. ripgrep uses PCRE2.

@fragmede
Copy link
Author

fragmede commented Aug 9, 2023

Ah thanks. Got confused tracking down dependencies. I'll file it with ag directly.

@PhilipHazel
Copy link
Collaborator

Closing this issue as not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants