http://regexlib.com/REDetails.aspx?regexp_id=284
This regular expression would work pretty good. I can build it into a function if you are unfamiliar with regexp.
As for making sure the mailbox and the domain aren't the same, I think writing a thing in asp would be the easiest.
You could do something like:
Code:
<%
Function SameMail_Domain(strAddress)
Dim aryMail
aryMail=Split(strAddress, "@")
If aryMail(0)=Mid(aryMail(1),1,InstrRev(aryMail(1),".")-1) Then
SameMail_Domain=True
Else
SameMail_Domain=False
End If
End Function
%>
<% If SameMail_Domain("blah@blah.com") Then %>
<p>The e-mail is the same!</p>
<% End If %>