title: Regex to validate a comma separated list of unique email addresses
body: <p>I need help troubleshooting a regex pattern. To validate a comma delimited list of unique email addresses I have this regex (<a href="https://regex101.com/r/8igywV/1/" rel="nofollow noreferrer">demo</a>):</p>
  <pre><code>^
  (?!.*(\b(?:[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})\b).*\b\1\b)
  (?:[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})
  (?:,(?:[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}))*
  $
  </code></pre>
  <p>This regex rightly matches these:</p>
  <pre><code>test@foo.com,test1@foo.com
  test.email@foo.com,test.email1@foo.com
  test.email@foo.com,test.email1@foo.com,test.email2@foo.com
  </code></pre>
  <p>But fails to match these (while it should):</p>
  <pre><code>test.email@foo.com,test1.email@foo.com
  test.email@foo.com,test+email@foo.com
  test-email@foo.com,test+email@foo.com
  test-email@foo.com,test%email@foo.com
  </code></pre>