title: Refactor this repetition that can lead to a stack overflow for large inputs Sonar
body: <p>I am trying the validate email with the following regex pattern,</p>
  <pre><code> @Pattern(regexp=&quot;^$|[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+&quot;, message = &quot;Email address invalid&quot;)
  </code></pre>
  <p>This regex works as expected, but Sonar highlights it to be critical bug:</p>
  <pre><code>Refactor this repetition that can lead to a stack overflow for large inputs.
  </code></pre>
  <p>Can you please help in shortening the regex, but logic should still remain same?</p>
  <p><img src="https://i.stack.imgur.com/gxGC6.png" alt="Picture for reference" /></p>