title: Can I use Regex in Rails .where()?
body: <p>I have a menu that shows the first letter of various artists:</p>
  
  <p><code>A B C D E F ...</code></p>
  
  <p>It basically is a way to filter many artists by first letter of name.</p>
  
  <p>The problem some begin with a symbol, a number, or anything other than <code>[a-z]</code>.</p>
  
  <p>So I want it to be</p>
  
  <p><code># A B C D E F ...</code></p>
  
  <p>But how do I go about making that work with my where clause?</p>
  
  <pre><code>filter_letter = (params[:letter] =~ /[a-z]/i ? params[:letter] : "something_here" )
  
  @artists = Artist.where("name LIKE ?", "#{filter_letter}%")
  </code></pre>