title: Regular Expressions Javascript
body: <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 cleanStr = str.replace(/_\W/g, "");
    return cleanStr;
  }
  
  palindrome("_eye");</code></pre>
  </div>
  </div>
  </p>
  
  <p>The above mentioned code returns "_eye" as the output. I might be missing something very obvious but why isn't the regular expression working? The intent is to remove any characters that are not words or numbers. </p>