<p>I have this gigantic ugly string:</p>
<pre class="lang-none prettyprint-override"><code>J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM
J0000010: Project name: E:\foo.pf
J0000011: Job name: MBiek Direct Mail Test
J0000020: Document 1 - Completed successfully
</code></pre>
<p>I'm trying to extract pieces from it using regex. In this case, I want to grab everything after <code>Project Name</code> up to the part where it says <code>J0000011:</code> (the 11 is going to be a different number every time).</p>
<p>Here's the regex I've been playing with:</p>
<pre class="lang-none prettyprint-override"><code>Project name:\s+(.*)\s+J[0-9]{7}:
</code></pre>
<p>The problem is that it doesn't stop until it hits the <strong>J0000020:</strong> at the end.</p>
<p>How do I make the regex stop at the first occurrence of <code>J[0-9]{7}</code>?</p>

Make
```
.*
```
non-greedy by adding '
```
?
```
' after it:
```
```
Project name:\s+(.*?)\s+J[0-9]{7}:
```
```