title: PHP Regex to remove everything after a character
body: <p>So I've seen a couple articles that go a little too deep, so I'm not sure what to remove from the regex statements they make.</p>
  
  <p>I've basically got this</p>
  
  <p><strong>foo:bar</strong> all the way to <strong>anotherfoo:bar;seg98y34g.?sdebvw h segvu</strong> (anything goes really)</p>
  
  <p>I need a PHP regex to remove EVERYTHING after the colon. the first part can be any length (but it never contains a colon. so in both cases above I'd end up with</p>
  
  <p><strong>foo</strong> and <strong>anotherfoo</strong></p>
  
  <p>after doing something like this horrendous example of psuedo-code</p>
  
  <pre><code>$string = 'foo:bar';
  $newstring = regex_to_remove_everything_after_":"($string);
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>after posting this, would an <code>explode()</code> work reliably enough? Something like</p>
  
  <pre><code>$pieces = explode(':', 'foo:bar') 
  $newstring = $pieces[0];
  </code></pre>