title: PHP: Replace all instances
body: <p>I have a chatlog file that looks like this (name represents screenames and text is their chat string)</p>
  
  <pre><code>name: some text
  name2: more text
  name: text
  name3: text
  </code></pre>
  
  <p>I want to color all names up to the <code>:</code> red. <br>For example: <code>&lt;font color=red&gt;myname:&lt;/fontcolor&gt; hello</code>
  How would I do this?</p>
  
  <p>I'm not sure why, but this code colors everything <em>after</em> the colon</p>
  
  <pre><code>echo preg_replace('/(.*?):/', "&lt;font color=#F00&gt;$1&lt;/font&gt;:", $output);
  </code></pre>