title: Replace Letters with Position in Alphabet - Regex
body: <p>This challenge's description is to take a string and replace the letters with  the letters position in the alphabet starting from 1-index. Requires you to skip  all non-characters including whitespace.</p>
  
  <pre><code>function alphabetPosition(text) {
    var result = [];
    var alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
      "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
      "w", "x", "y", "z"]
    text = text.replace(/\W*\d+/g, '').toLowerCase().split('');
    for (var i = 0; i &lt; text.length; i++) 
      result.push(alphabet.indexOf(text[i]) + 1);
    return result.join(' ');
  }
  </code></pre>
  
  <p>My problem is when it comes to random tests, the input will contain digits and non word characters but the Regex isn't recognizing it. The input is <code>n8_ovuu&amp;</code> and the output/error is <code>Expected: '14 15 22 21 21', instead got: '14 0 15 22 21 21 0'</code></p>
  
  <p>The problem lies in the Regex, but I can't figure it out. If you have any idea I would appreciate the help!</p>