Added simple test case.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@125 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: MailUtil.java,v 1.1 2001/05/26 07:08:00 mdb Exp $
|
// $Id: MailUtil.java,v 1.2 2001/05/26 07:10:09 mdb Exp $
|
||||||
|
|
||||||
package com.samskivert.net;
|
package com.samskivert.net;
|
||||||
|
|
||||||
@@ -55,6 +55,12 @@ public class MailUtil
|
|||||||
return _emailre.match(address);
|
return _emailre.match(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main (String[] args)
|
||||||
|
{
|
||||||
|
String address = "mdb@samskivert.com";
|
||||||
|
System.out.println(address + ": " + isValidAddress(address));
|
||||||
|
}
|
||||||
|
|
||||||
/** Originally formulated by lambert@nas.nasa.gov. */
|
/** Originally formulated by lambert@nas.nasa.gov. */
|
||||||
protected static final String EMAIL_REGEX = "^([-A-Za-z0-9_.!%+]+@" +
|
protected static final String EMAIL_REGEX = "^([-A-Za-z0-9_.!%+]+@" +
|
||||||
"[-a-zA-Z0-9]+(\\.[-a-zA-Z0-9]+)*\\.[-a-zA-Z0-9]+)$";
|
"[-a-zA-Z0-9]+(\\.[-a-zA-Z0-9]+)*\\.[-a-zA-Z0-9]+)$";
|
||||||
|
|||||||
Reference in New Issue
Block a user