metacpan / metacpan-grep-front-end

Grep Front end code
GNU General Public License v3.0
13 stars 12 forks source link

grep is returning wrong stuff: it's buggy #41

Open khwilliamson opened 6 years ago

khwilliamson commented 6 years ago

Context

If I search for ({\d+(,\d+)?}

https://grep.metacpan.org/search?q=%5C%28%5C%7B%5Cd%2B%28%2C%5Cd%2B%29%3F%5C%7D&qd=&qft=

one result I get is this (for Language::Expr)

{category=>'map', has_subexpr=>1, text=>'map({1<}, [])', parse_error=>qr/invalid syntax/i}, # invalid subexpression

That does not match the input expression. There is a '<' that it seems to think is a \d

If I do the same search on grep.cpan.me, I get many more results.

https://grep.cpan.me/?q=%5C%28%5C%7B%5Cd%2B%28%2C%5Cd%2B%29%3F%5C%7D&page=3

I'm not sure that there is any overlap between the results, which would mean it also is buggy

haarg commented 6 years ago

I believe this is the same issue as #41. There is an odd attempt at regex sanitization that I believe should be removed.

khwilliamson commented 3 years ago

I found another case where bad results are returned. With the demise of grep.cpan.me, this module is all we have, and not being able to rely on its accuracy is a big deal.

If @haarg is right, this should be an easy fix.

The new failing search is \bOff\s( without the \s it finds things that it should also find with the \s*

khwilliamson commented 3 years ago

\bOff\s*\( rather. Without quoting, github stripped things