title: Ruby - validate user input against allowed characters
body: <p>i am stuck at validating user input.
  i have set of allowed characters "R G B Y" and i am asking for user input. I want to validate if user inputs ONLY characters that are allowed ("R G B Y").</p>
  
  <p>User can input whatever he or she wants as long as input include allowed characters, for example:</p>
  
  <pre><code>user_input1 = "R R R Y"
  user_input2 = "Y Y B G"
  </code></pre>
  
  <p>and so on...</p>
  
  <p>i am totally stuck, i tried with regex:</p>
  
  <pre><code>/[RGBY]/
  </code></pre>
  
  <p>it is working fine if user inputs allowed characters, but if there will be a mix of allowed and not allowed characters, regex won't catch it :( for example:</p>
  
  <pre><code>wrong_user_input = "Z Z R Y"
  </code></pre>
  
  <p>i know regex is overkill for this simple task but i cannot think of something else in this moment. 
  any help would be appreciated....
  thanks!</p>