JavaScript: check a string matches a regex?
<p>I want to use JavaScript (or jQuery) to do some client-side validation to check whether a string matches the regex:</p>

<pre><code>^([a-z0-9]{5,})$
</code></pre>

<p>Ideally it would be an expression that returned true or false. </p>

<p>I'm a JavaScript newbie, does <code>match()</code> do what I need? It seems to check whether part of a string matches a regex, not the whole thing. </p>
