# New extension: Multiple Matches (grep)

**URL:** <https://forum.codecrafters.io/t/new-extension-multiple-matches-grep/15575>\
**Category:** Announcements\
**Created:** [November 30, 2025, 7:45pm UTC](https://forum.codecrafters.io/t/new-extension-multiple-matches-grep/15575 "2025-11-30T19:45:46Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [November 30, 2025, 7:45pm UTC](https://forum.codecrafters.io/t/new-extension-multiple-matches-grep/15575/1 "2025-11-30T19:45:46Z")

</div>

The next extension for the grep challenge is now live: **Multiple Matches**.

This extension introduces the `-o` flag (–only-matching), which prints just the portion of each line that matches the pattern, rather than the entire line.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/6/1/61c1eb641b000d4f6498041ce81d9eeb8e858637.jpeg)

By the end of this extension, your grep implementation will support printing only the matched text.

```auto
$ echo -n "The king had 10 children" | grep -o -E '\d'
1
0

```

Here’s the stage breakdown:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/8/783acf1bd16fbce021bc54e5dfd1893010180373.png)

Please [give this a try](https://app.codecrafters.io/courses/grep/overview) and let us know how it can be improved! @UdeshyaDhungana (author of this extension) and I will be available here to help out with any tester or instruction-related issues.
