title: ruby regex - how to match everything up till the character -
body: <p>given a string as follow:</p>
  
  <pre><code>randomstring1-randomstring2-3df83eeff2
  </code></pre>
  
  <p>How can I use a ruby regex or some other ruby/rails friendly method to find everything up until the first dash - </p>
  
  <p>In the example above that would be: <strong>randomstring1</strong></p>
  
  <p>Thanks</p>