# Anyone here know GREP? \[Solved}

**URL:** <https://forums.realmacsoftware.com/t/anyone-here-know-grep-solved/30426>\
**Category:** Lounge\
**Created:** [December 31, 2019, 1:21am UTC](https://forums.realmacsoftware.com/t/anyone-here-know-grep-solved/30426 "2019-12-31T01:21:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1611mac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/1611mac/32/5675_2.png) [@1611mac](https://forums.realmacsoftware.com/u/1611mac)\
**Post date:** [December 31, 2019, 1:21am UTC](https://forums.realmacsoftware.com/t/anyone-here-know-grep-solved/30426/1 "2019-12-31T01:21:19Z")

</div>

`\$\$(.*)the`  
finds “$$” “any text” up to and including the last occurrence of “the” in a paragraph.

How can I find same but only up to the FIRST occurend of “the”?

Thanks.

Update: Solved… found the answer. thanks.

---

<div class="post-metadata">

**Author:** ![douga](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/douga/32/17641_2.png) [@douga](https://forums.realmacsoftware.com/u/douga)\
**Post date:** [December 31, 2019, 5:19am UTC](https://forums.realmacsoftware.com/t/anyone-here-know-grep-solved/30426/2 "2019-12-31T05:19:08Z")

</div>

> [@1611mac](#):
>
> Solved… found the answer. thanks.

Could you let us know what it was? Really interested.

---

<div class="post-metadata">

**Author:** ![1611mac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/1611mac/32/5675_2.png) [@1611mac](https://forums.realmacsoftware.com/u/1611mac)\
**Post date:** [December 31, 2019, 11:07am UTC](https://forums.realmacsoftware.com/t/anyone-here-know-grep-solved/30426/3 "2019-12-31T11:07:13Z")

</div>

Answer to my example: /$/$(.\*)the?  
Use of the “?” (question mark) quantifier is needed. It basically limits any find to the first occurance of a find and not the last. By default a “Grep” search will find the “widest” possible match. The Question Mark quantifier limits to the first match.

BBedit’s Grep help  
[https://anybrowser.org/bbedit/grep.html](https://anybrowser.org/bbedit/grep.html)
