the_silver_searcher icon indicating copy to clipboard operation
the_silver_searcher copied to clipboard

Smart case takes into account the uppercase letter from an escaped pattern

Open ariel-miculas opened this issue 6 years ago • 2 comments

Setup: Text file containing 'EXAMPLE'

Description: ag 'exampl\D' -> does not match, smart case performs the search case sensitive because it has encountered the uppercase letter D, but in fact '\D' matches any non-digit

Expectation: the search should be performed case insensitive and the '\D' should not count for an uppercase letter because it is an escaped character

ariel-miculas avatar Oct 09 '18 13:10 ariel-miculas

The same problem occurs with character properties, such as \p{N} for example, because N is considered an upper case letter. I tested ag 2.2.0.

genivia-inc avatar Jan 20 '20 22:01 genivia-inc

same. Just ran into this bug when using \W in a search pattern. Was very confusing. Sadly looks like this project is a bit abandoned these days. (though this is the first bug in ag I've ever noticed in 8+ years of using it)

varenc avatar Jun 02 '22 23:06 varenc