title: Pattern matching email address in SQL Server
body: <p>We're getting fraudulent emails in our database, and are trying to make an alert to find them. Some example of email addresses we are getting:</p>
  
  <p><em>addisonsdsdsdcfsd@XXXX.com<br />
  agustinasdsdfdf@XXXX.com</em></p>
  
  <p>I want the query to search for:<br />
  <strong>pattern of consonants and pattern length > 4 characters</strong></p>
  
  <p>Here's what I have so far, I can't figure out how to get it to search for the length of the string. Right now it's catching addresses that have even two consonants back to back, which I want to avoid because that catches emails like bobsaget@xxxx.com. </p>
  
  <pre><code>select * from recips
  where address like like '%[^aeiou]@%'
  </code></pre>
  
  <p><strong>UPDATE</strong> </p>
  
  <p>I think there is some misunderstanding of what I am trying to find, this is not a query for validating emails, we are simply trying to spot patterns in our signups for fraudulent emails.</p>
  
  <p>we are searching on other criteria besides this, such as datelastopened/clicked, but for the sake of keeping the question simple I only attached the string that searches for the pattern. We don't mail to anyone who has hardbounced more than once. However, these emails in particular are bots that still find a way to click/open and don't hardbounce. They are also coming from particular sets of IP blocks where the first octets are the same, and these IP blocks vary.</p>
  
  <p>this is by no means our first line of defense, this is just a catch-all to make sure we catch anything that slips through the cracks</p>