Jump to content


Photo

ereg() not working as expected...


  • Please log in to reply
2 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 11 March 2006 - 11:32 PM

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

How do I fix it?

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


#2 sgb162

sgb162
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 12 March 2006 - 01:21 AM

If you're trying to ignore all capital letters, [^A-Z] should do it just fine..

#3 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 12 March 2006 - 06:44 AM

[!--quoteo(post=354052:date=Mar 12 2006, 01:21 AM:name=sgb162)--][div class=\'quotetop\']QUOTE(sgb162 @ Mar 12 2006, 01:21 AM) View Post[/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 [=

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users