title: Regex Javascript: check for palindromes
body: <p>I'm attempting to find a solution to check for a palindrome. When I use the code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function palindrome(str) {
    var checkSpecial = str.replace(/[^A-Za-z0-9]/g, '');
    var checkPalindrome = str.split('').reverse().join('');
    return checkSpecial == checkPalindrome;
  }
  console.log(palindrome("_eye")); // false</code></pre>
  </div>
  </div>
  </p>
  
  <p>It returns false. I can't seem to get non-alphanumeric characters to remove.</p>