Here's what i have in my custom email validator:
private static String ATOM =
"[^\\x00-\\x1F^\\(^\\)^\\<^\\>[EMAIL
PROTECTED],^\\;^\\:^\\\\^\\\"^\\.^\\[^\\]^\\s]";
private static String DOMAIN = "(" + ATOM + "+(\\." + ATOM + "+)*";
private static String IP_DOMAIN =
"\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\]";
private static Pattern PATTERN = java.util.regex.Pattern.compile("^" +
ATOM + "+(\\." + ATOM + "+)*@" + DOMAIN + "|" + IP_DOMAIN + ")$",
java.util.regex.Pattern.CASE_INSENSITIVE);
If your using T5 i can send you the whole validator class if it helps.
mj123 wrote:
> I need a Regular expression that will validate an email adrress entered
>
> Currently I am using "[EMAIL PROTECTED],4}$"
> which is not doing the job
>
> it should follow these rules
>
> /**
> * <p>Is the specified email valid? Checks against that the following
> rules
> * are complied with:
> * <ol>
> * <li>No @ symbol</li>
> * <li>Any more than 1 @ symbol</li>
> * <li>Any spaces</li>
> * <li>No chars before @ symbol</li>
> * <li>No chars after @ symbol</li>
> * <li>email starts or ends with . (period)</li>
> * <li>If domain name contains no . (period)</li>
> * <li>If first character of the domain name is a . (period)</li>
> * <li>If last character of the domain name is a . (period)</li>
> * <li>Any x 2 .. (periods) </li>
> * </ol>
> * </p>
> */
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]