title: gawk regex to find any record having characters other then the specified by character class in regex pattern
body: <p>I have list of email addresses in a text file. I have a pattern having character classes that specifies what characters are allowed in the email addresses. 
  Now from that input file, I want to only search the email addresses that has the characters other than the allowed ones. 
  I am trying to write a gawk for the same, but not able to get it to work properly.
  Here is the gawk that I am trying:</p>
  
  <pre><code>gawk -F "," ' $2!~/[[:alnum:]@\.]]/ { print "has invalid chars" }' emails.csv
  </code></pre>
  
  <p>The problem I am facing is that the above gawk command only matches the records that has NONE of the alphanumeric, @ and . (dot) in them. But what I am looking for is the records that are having the allowed characters but along with them the not-allowed ones as well.</p>
  
  <p>For example, the above command would find </p>
  
  <blockquote>
    <p>"_-()&amp;<em>(</em>()%"</p>
  </blockquote>
  
  <p>as the above only has the characters not in regex pattern, but will not find </p>
  
  <blockquote>
    <p>"abc-123@xyz,com"</p>
  </blockquote>
  
  <p>. as it also has the characters that are present in specified character classes in regex pattern.</p>