title: Java Pattern validation annotation and util Regex pattern behave differently
body: <p>I have a regex </p>
  
  <pre><code>^(?=[a-zA-Z0-9,!@#$&amp;*()_'+-=&lt;&gt;.?{}\\[\\]|; :\\s]*$)(?!.*[/])
  </code></pre>
  
  <p>and I tried the regex through two approaches for string <code>"hello"</code>:</p>
  
  <ol>
  <li><code>java.util.regex.Pattern</code> : would pass the test</li>
  <li><code>javax.validation.constraints.Pattern</code> (annotation): would throw an error that invalid values are present.</li>
  </ol>
  
  <p>Does anyone have any idea why these two are behaving differently?</p>