I am trying to verify the domain part of an email message, and I want to verify that there are no two consecutive points in the domain, that is, the following are not valid.
- joe @ ms..com
- joe @ ms.com..uk
- joe @ .. ms.com
- joe@ms.com.au..
I have a regex to find it
@+\.{2}|@.+\.{2}
but I use the Regex attribute in .NET and want to build a valid regular expression (i.e. a single number), and not the one that fails
I thought the ^ symbol means
all that is NOT an expression
so I thought ^(@+\.{2}|@.+\.{2}) would work, but it doesnβt support the .NET Framework EmailAddress Attribute - it stops joe@ms..com but does not stop joe@ms.com..au
source share