# \[grep\] \[#NY8\] incorrect example \`dogs? does not match "dogss" (two "s")\`

**URL:** <https://forum.codecrafters.io/t/grep-ny8-incorrect-example-dogs-does-not-match-dogss-two-s/15437>\
**Category:** Bug Reports\
**Tags:** challenge:grep\
**Created:** [October 25, 2025, 7:29pm UTC](https://forum.codecrafters.io/t/grep-ny8-incorrect-example-dogs-does-not-match-dogss-two-s/15437 "2025-10-25T19:29:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew-russo](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/matthew-russo/32/13655_2.png) [@matthew-russo](https://forum.codecrafters.io/u/matthew-russo)\
**Post date:** [October 25, 2025, 7:29pm UTC](https://forum.codecrafters.io/t/grep-ny8-incorrect-example-dogs-does-not-match-dogss-two-s/15437/1 "2025-10-25T19:29:44Z")

</div>

grep stage #NY8 has an incorrect example:  
`dogs?` does not match `dogss` (two “s”)

this correctly matches the substring `dogs`.

in a terminal with a text file `test.txt` containing `dogss` produces a match with:  
`grep -E ‘dogs?’ test.txt`

previous challenges such as #RR8 have examples where it shows the pattern matching a prefix without needing to match the entire string

- `^log` matches `"logs"` (starts with “log”)

- `^\d\d\d` matches `"123abc"`

to make this a correct example, the pattern should be `dogs?$`

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [October 26, 2025, 11:15pm UTC](https://forum.codecrafters.io/t/grep-ny8-incorrect-example-dogs-does-not-match-dogss-two-s/15437/4 "2025-10-26T23:15:09Z")

</div>

Hey @matthew-russo, great catch! We’re addressing the issue in [this PR](https://github.com/codecrafters-io/build-your-own-grep/pull/174/files).

Let us know if you spot anything else!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [November 2, 2025, 11:43pm UTC](https://forum.codecrafters.io/t/grep-ny8-incorrect-example-dogs-does-not-match-dogss-two-s/15437/6 "2025-11-02T23:43:27Z")

</div>

Closed on November 2, 2025, 11:43pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
