chemdude
Full Member
2B || !2B
Posts: 228
|
Post by chemdude on Nov 15, 2005 1:19:48 GMT
Yes! This board is now more open! I hope we can talk about asp.net here too...
Back on topic:
Well, I thought they were the same as javascript regular expressions. Apparently they're not because I get errors. So, I simplified my email validation regexp, and I want it to match "@" or "" (that's right, I want it to match "@" or nothing). I know how to match the "@" and the characters around it with "/^((.+?)@(.+?))$/i" but I thought "/^((.+?)@(.+?))|()$/i" would match the "@" or nothing, but it doesn't seem to work. Does anybody know the regexp to do this?
btw I also want a separate regexp that matches "." or nothing.
|
|
|
Post by acoolie530 on Nov 15, 2005 2:19:45 GMT
First of all, you can use if(preg_match("/^((.+?)@(.+?))$/i", $str) || empty($str)). Here are some useful links for email validation. Eregi - Php.net Preg_match - Php.net Email
And yes, you can post about ASP in here.
|
|
|
Post by raisingdad on Nov 15, 2005 10:55:06 GMT
Yes! This board is now more open! I hope we can talk about asp.net here too... Yes, all server side coding languages are 'supported', we only had room to mention a few. And by 'supported', I mean you won't get yelled at for posting about them - however I can't guarantee people here would be able to help with 'x' language.
|
|
|
Post by [dmsuperman] on Nov 15, 2005 20:11:22 GMT
/^((.+?)@(.+?))$/i I would use this though: /^((.+?)@(.+?)\.(.+?))$/i That matches a period in the domain.
|
|
chemdude
Full Member
2B || !2B
Posts: 228
|
Post by chemdude on Nov 15, 2005 21:05:24 GMT
Thanks a lot. It's working fine now, and my first php mini-project is complete. I turned the code from here into a full-featured guestbook that works great overall.
|
|