BurntSushi/ripgrep

Support apply smart case to each individual search pattern separately

Open

#1.791 aberto em 31 de jan. de 2021

Ver no GitHub
 (2 comments) (1 reaction) (0 assignees)Rust (2.559 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (63.768 stars)
Métricas de merge de PR
 (Mesclagem média 2d 12h) (5 fundiu PRs em 30d)

Description

Describe your feature request

ripgrep support to search several patterns together by -e or listing patterns in a file and using -f to specify the file. Meanwhile, --smart-case option can judge search pattern if it needs a case sensitive searching. But, for now, all patterns are treated together to match the smart case rule. i.e. if I use rg -S -e Abc -e bcd, search pattern bcd also be treated as case sensitive. So, I think it's better to support apply smart case rule to every search pattern separately, especially in the -f usage. But I am not sure if patterns in a single regex should support this.

I think ripgrep's man page for this change would be like:

 -S, --smart-case
            Searches case insensitively if the pattern is all lowercase. Search case
            sensitively otherwise. Every individual search pattern follow this rule 
            by itself, including PATTERN specified by -e and patterns in PATTERNFILE
            specified by -f.

Guia do colaborador