starting with regexes : <p><em>disclaimer: entirely new to regexes</em></p>

<p>I am trying to write a simple regex to validate email strings like this:</p>

<pre><code>/^\w+@\w+\.\w{1,4}/.test(emailstring);
</code></pre>

<p>The above should return false for = a@d.abcde but true for a@d.abcd. I need the extension to be limited to four characters {1,4}. But it always returns true for any length of tld extension. What's wrong in the above expression?</p>
