Re: help with sed-friendly regex with negative look-ahead syntax for sendmail

"Rob Kudyba [email protected] [sed-users]" <[email protected]> Thu, 23 Feb 2017 20:26:09 +0000 (UTC)
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
If you look at the guide in http://www.xiitec.com/blog/2009/02/25/using-regular-expressions-in-sendmail/, the goal is to reject emails from certain top level domains, such as .info, .us. and .bid but only if they have a subdomain. So:
good: [email protected], so *@*.usbad: [email protected], so *@*.*.us
This regex works:[a-zA-Z_0-9.-]+\@[a-zA-Z_0-9-]+?\.+[a-zA-Z_0-9.-]+?\.(us|info|bid)
I'm trying to include/append to the beginning of the above regex, a negative look-ahead that would, in essence, ignore emails like:1) [email protected] so *@ci.*.us2) [email protected] (and state is one of the 50 states or DC) so *@*.ny.us (ny or any other state that is)

[Non-text portions of this message have been removed]