title: Regex to replace email address domains?
body: <p>I need a regex to obfuscate emails in a database dump file I have. I'd like to replace all domains with a set domain like <code>@fake.com</code> so I don't risk sending out emails to real people during development. The emails do have to be unique to match database constraints, so I only want to replace the domain and keep the usernames.</p>
  
  <p>I current have this regex for finding emails</p>
  
  <pre><code>\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
  </code></pre>
  
  <p>How do I convert this search regex into a regex I can use in a find and replace operation in either Sublime Text or SED or Vim?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Just a note, I just realized I could replace all strings found by <code>@[A-Z0-9.-]+\.[A-Z]{2,4}\b</code> in this case, but academically I am still interested in how you could treat each section of the email regex as a token and replace the username / domain independently.</p>