javascript test amazing
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7331753/strange-behavior-of-javascript-regex-test-function">Strange behavior of Javascript regex test function</a>  </p>
</blockquote>



<pre><code>var pattern = /\((\S+)\)/gi;

pattern.test("test(abc)")   true

pattern.test("test(abc)")   false

pattern.test("test(abc)")   true

pattern.test("test(abc)")   false

.
.
.
</code></pre>

<p>why?</p>
