grep - the interval `{,}` (`\{,\}` in BRE) is rejected or read literally; GNU reads it as `{0,}`
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start by locating the regex parsing and matching paths for basic and extended modes, then review the existing grep tests and the GNU bre test, especially Spencer BRE test #40. Add coverage for \{,\} and {,} matching zero or more occurrences, using the supplied reproduction and expected output. Done means both modes select the same lines as GNU grep and the regression test passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Known: closed PR #152 (closed by its author without merging) — https://github.com/uutils/grep/pull/152
GNU grep reads an interval with neither bound, {,}, as {0,} (the same as *). In basic
mode uu_grep rejects \{,\} with an Oniguruma error and exit 2; in extended mode it reads
{,} as literal text and so selects different lines. PR #152 rewrote the pattern text and
was closed; no issue tracks the behaviour.
Exposed by the GNU test bre (Spencer BRE test #40, a\{,\} must match a\{,\}).
Reproduction
Rust (incorrect)
$ printf 'mo\nmooo\n' | ./target/release/grep 'mo\{,\}'
grep: invalid pattern "mo\{,\}": invalid repeat range {lower,upper}
# Exit code: 2
$ printf 'mo\nmooo\n' | ./target/release/grep -E 'mo{,}'
# Output: (none)
# Exit code: 1
GNU (correct)
$ printf 'mo\nmooo\n' | LC_ALL=C /usr/bin/grep 'mo\{,\}'
mo
mooo
# Exit code: 0
$ printf 'mo\nmooo\n' | LC_ALL=C /usr/bin/grep -E 'mo{,}'
mo
mooo
# Exit code: 0
Test
#[test]
fn empty_interval_means_zero_or_more() {
for args in [&["-c", "bz\\{,\\}"][..], &["-c", "-E", "bz{,}"][..]] {
let (_s, mut c) = ucmd();
c.args(args)
.pipe_in("b\nbzzz\nq\n")
.succeeds()
.stdout_only("2\n");
}
}
Exposed by the GNU grep test suite: bre.
- Lingua principale
- Rust
- Stelle
- 147
- Fork
- 34
- Merge medio
- 3g 18h
- PR unite (30g)
- 21
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di uutils/grep
-
grep - `-L` with `-m 0` or `-v ''` prints nothing; GNU still lists every fileForse già presa @yunusarda-sudo l’ha presa 5 giorni fa. Apertabug gnu-compat good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 2 giorni
-
grep - `-v -o` with `-A`/`-B`/`-C` prints nothing; GNU prints the matches found in the context linesApertabug gnu-compat good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 2 giorni
-
grep - interval counts above 32767 are accepted; GNU rejects them with `Regular expression too big`Forse già presa @yunusarda-sudo l’ha presa 5 giorni fa. Apertabug gnu-compat good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 2 giorni
-
grep - `--exclude-dir=./dir` does not exclude the operand `./dir`Forse già presa @yunusarda-sudo l’ha presa 5 giorni fa. Apertabug gnu-compat good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni
-
bug gnu-compat good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
Issue simili
-
marketing
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
S: Untriaged T: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
libnyanpasu/clash-nyanpasu#6537 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 62/100
tauri-apps/tao#1445 ·
I maintainer di solito rispondono entro 1 giorno
-
bug P3
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
go good first issue test
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 2 giorni