title: Validate that string contains only allowed characters in Ruby
body: <p>How can I test whether a Ruby string contains only a specific set of characters?</p>
  
  <p>For example, if my set of allowed characters is <code>"AGHTM"</code> plus digits <code>0-9</code>,</p>
  
  <ul>
  <li><p>the string <code>"MT3G22AH"</code> is <em>valid</em>;</p></li>
  <li><p>the string <code>"TAR34"</code> is <em>invalid</em> (because of the <code>R</code>).</p></li>
  </ul>