Validating an email address in a regexp is somewhat impractical.

The problem is that emails are far more lenient than you might think.

However, if you're willing to ignore the standard and go with what
most people consider a valid email address...

try something like:

theEmailAddress.matches("[EMAIL PROTECTED]
{2,}$");

I've read the almost complete one at one point or other, and it was
half a screen long. I can't find it, unfortunately.

Personally, I'd check for an @, a . in the server name, no whitespace,
and other than that, accept it.

On Nov 17, 8:06 pm, omsrobert <[EMAIL PROTECTED]> wrote:
> How do you use regular expressions in GWT?  Can someone post a small
> code sample?  I'm looking to validate an e-mail address against a RFC.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to