Regular expression with javascript
<p>I have following code in java script</p>

<pre><code>    var regexp = /\$[A-Z]+[0-9]+/g;
    for (var i = 0; i &lt; 6; i++) {
        if (regexp.test("$A1")) {
            console.log("Matched");
        }
        else {
            console.log("Unmatched");
        }
    }
</code></pre>

<p>Please run it on your browser console. It will print alternative <strong>Matched</strong> and <strong>Unmatched</strong>. Can anyone tell the reason for it.</p>
