Javascript regexp using val().match() method
<p>I'm trying to validate a field named phone_number with this rules:</p>

<p>the first digit should be 3 then another 9 digits so in total 10 number example: 3216549874</p>

<p>or can be 7 numbers 1234567</p>

<p>here i have my code:</p>

<pre><code>        if (!($("#" + val["htmlId"]).val().match(/^3\d{9}|\d{7}/)))
            missing = true;
</code></pre>

<p>Why doesnt work :( when i put that into an online regexp checker shows good.</p>
