grep - the interval `{,}` (`\{,\}` in BRE) is rejected or read literally; GNU reads it as `{0,}`
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 147
- Fork
- 34
- Merge trung bình
- 3 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của uutils/grep
-
grep - `-L` with `-m 0` or `-v ''` prints nothing; GNU still lists every fileCó thể đã có người làm @yunusarda-sudo đã nhận 5 ngày trước. Đang mởbug gnu-compat good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 2 ngày
-
grep - `-v -o` with `-A`/`-B`/`-C` prints nothing; GNU prints the matches found in the context linesĐang mởbug gnu-compat good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 2 ngày
-
grep - interval counts above 32767 are accepted; GNU rejects them with `Regular expression too big`Có thể đã có người làm @yunusarda-sudo đã nhận 5 ngày trước. Đang mởbug gnu-compat good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 2 ngày
-
grep - `--exclude-dir=./dir` does not exclude the operand `./dir`Có thể đã có người làm @yunusarda-sudo đã nhận 5 ngày trước. Đang mởbug gnu-compat good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug gnu-compat good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
Issue tương tự
-
marketing
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
S: Untriaged T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
libnyanpasu/clash-nyanpasu#6537 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 62/100
tauri-apps/tao#1445 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P3
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
-
go good first issue test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày