Jump to content

ereg() not working as expected...


AV1611

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]
Link to comment
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 [=
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.