title: Ruby: How do I capture part of a string with regex?
body: <p>I have </p>
  
  <pre><code>  file_ext = attach.document_file_name.capture(/\.[^.]*$/)
  </code></pre>
  
  <p>but i guess there is no method capture.</p>
  
  <p>I'm trying to get the file extension from a string. I don't yet have the file.</p>