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:
If aryMail(0)=Mid(aryMail(1),1,InstrRev(aryMail(1),".")-1) Then
<% If SameMail_Domain("email@example.com") Then %>
<p>The e-mail is the same!</p>
<% End If %>