title: How can I extract the domain from an email without using Regex, in Ruby?
body: <p>Given an email address in the form, <code>'foo@bar.com'</code> or <code>'rhubarb.foo@bar.com'</code>, how can one extract only the domain <code>bar</code> (not <code>bar.com</code>), <strong>without</strong> resorting to regex or a specialist library?</p>
  
  <p>This post: '<a href="https://stackoverflow.com/questions/4699754/how-to-get-domain-from-email">How to get domain from email</a>' <em>almost</em> answers my question, but I am unsure how to split domain <code>'bar.com'</code>, or whether another approach might exist.</p>