title: Difference in results between Java matches vs JavaScript match
body: <p>I was brushing up on my regular expressions in java when I did a simple test</p>
  <pre><code>Pattern.matches(&quot;q&quot;, &quot;Iraq&quot;); //false
  &quot;Iraq&quot;.matches(&quot;q&quot;); //false
  </code></pre>
  <p>But in JavaScript</p>
  <pre><code>/q/.test(&quot;Iraq&quot;); //true
  &quot;Iraq&quot;.match(&quot;q&quot;); //[&quot;q&quot;] (which is truthy)
  </code></pre>
  <p>What is going on here? And can I make my java regex pattern &quot;q&quot; behave the same as JavaScript?</p>