title: Return first match of Ruby regex
body: <p>I'm looking for a way to perform a regex match on a string in Ruby and have it short-circuit on the first match.</p>
  
  <p>The string I'm processing is long and from what it looks like the standard way (<code>match</code> method) would process the whole thing, collect each match, and return a MatchData object containing all matches.</p>
  
  <pre><code>match = string.match(/regex/)[0].to_s
  </code></pre>