Instead of using some super long regex why not code the logic by hand
(the old fashion way without regex). I find that often the resulting
code is easier to read and in this case it might actually turn out to be
shorter. Maybe :)

Gili

Frank Bille Jensen wrote:
> On Wed, 2006-06-21 at 12:02 -0400, Michael Day wrote:
>> I only glanced quickly at the larger expression, but it seems to  
>> allow for quite a bit that you would NOT want.  I think it's more  
>> geared toward mail servers.  For example, I think it will evaluate  
>> the following as a valid email address (possibly with random tabs and  
>> spaces throughout):  <[EMAIL PROTECTED]>
> 
> Below are some (according to the RFC) valid email adresses. I think the
> ones to notice is the ones with a space in 'em.
> 
> VALID_EMAIL1.setAddress("[EMAIL PROTECTED]");
> VALID_EMAIL2.setAddress("[EMAIL PROTECTED]");
> VALID_EMAIL3.setAddress("[EMAIL PROTECTED]");
> VALID_EMAIL4.setAddress("[EMAIL PROTECTED]");
> VALID_EMAIL5.setAddress("[EMAIL PROTECTED]");
> VALID_EMAIL6.setAddress("my @email.com");
> VALID_EMAIL7.setAddress("my@ email.com");
> VALID_EMAIL8.setAddress("\"Ulrik Jensen\"@email.com");
> 
> 
> 
>> Is this what most people want?  Probably not.  I would prefer to  
>> ensure the email address is in a format like this: [EMAIL PROTECTED]  And  
>> I think the smaller expression will validate emails in this format  
>> just fine.
> 
> 
> I agree. If Wicket used the RFC correct validation pattern and
> developers forgot to check whether there mailing systems actually were
> able to handle such email addresses they would probably be quite
> frustrated.
> 
> 
> How about having a RfcCompliantEmailAddressPatternValidator living next
> to the normal EmailAddressPatternValidator? Then developers would only
> pick the RFC compliant version if they actually needed it. Just a
> thought.
> 
> 
> Regards
> Frank Bille
> Avaleo
> 
> 
> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> Fully trained technicians. The highest number of Red Hat certifications in
> the hosting industry. Fanatical Support. Click to learn more
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user

Attachment: signature.asc
Description: OpenPGP digital signature

All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to