dws: No no, he wants to reverse the test.
The problem is that he uses a zero-width assertion, hence the \. is required to be at the end of the string.. so that obviously won't work
jwx: basically your regex says the period may not be followed by 'br', 'com', 'net', or 'org' .. but you're also not permitting anything else to follow it. A solution, although not very pretty, would be to explicitly match a word after the period:
.+\.(?!br|com|net|org)\w*
The zero-width assertion will make sure that the word doesn't begin with 'br', 'com', 'net', or 'org'. I can't think of any top-level domains that begin with those but aren't equal to it, but if you're worried then this should work:
.+\.(?!(?:br|com|net|org)$)\w*
BTW, as dws says.. a pretty heavy-handed way to deal with your email.. (I'm in 'nl' myself, so if I'd email you it would be discarded as spam?)
•Update: changed \w+ to \w* to discard addresses that end in a period as "spam" |