Javascript regular expression to check a string like x.0.0
<p>I have the following:</p>

<pre><code>    if (/0\.0$/.test(text))
</code></pre>

<p>I am using this successfully to check for text ending in 0.0 such as:</p>

<pre><code>1.0.0 
2.0.0
3.0.0
</code></pre>

<p>However it also works for the following:</p>

<pre><code>1.10.0
2.10.0
</code></pre>

<p>Is there a way I can change this expression so it only gives true for the first 3 values and not the second two?</p>

<p>Here's my complete code:</p>

<pre><code>    if (/0\.0$/.test(text))
        pad = 10;
    else if (/\.0$/.test(text))
        pad = 35;
    else
        pad = 60;
    tdToPad.css('margin-left', pad);
</code></pre>

<p>For the case where text is 2.10.0 it should pad with 35 but it is padding with 10.</p>
