Jump to content

Archived

This topic is now archived and is closed to further replies.

AV1611

ereg() not working as expected...

Recommended Posts

This doesn't seem to allow CAPITOL letters...
[code]
if(!ereg("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$",$email)
[/code]

How do I fix it?

I did this, and it works... isn't there a better way to tell it to ignore Capitols?
[code]
if(!ereg("^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*(.[a-zA-Z]{2,3})$",$email)
[/code]

Share this post


Link to post
Share on other sites
If you're trying to ignore all capital letters, [^A-Z] should do it just fine..

Share this post


Link to post
Share on other sites
[!--quoteo(post=354052:date=Mar 12 2006, 01:21 AM:name=sgb162)--][div class=\'quotetop\']QUOTE(sgb162 @ Mar 12 2006, 01:21 AM) [snapback]354052[/snapback][/div][div class=\'quotemain\'][!--quotec--]
If you're trying to ignore all capital letters, [^A-Z] should do it just fine..
[/quote]

no silly he's trying to allow 'a-z A-Z 1-9 . a-z A-Z 1-9 @ a-z A-Z 1-9 . a-z A-Z 1-9' and underscores

anyway, there is no other way that i know of bud.. but a great regex it was [=

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.