![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
eregi("[A-Z]+"); include a-z or not? I think it does. But that's just me thinking :-) Me, too. |
|
And thanks for uploading the nice pics. |
#22
| |||
| |||
|
|
On 2008-03-27, Els <els.aNOSPAM (AT) tiscali (DOT) nl> wrote: Sounds like the safest bet would be to use A-z ? That's a good idea, although I don't have total confidence that it's either AaBbCc... or ABC...abc... and not some other other strange order in some locales. |
#23
| |||
| |||
|
|
Els wrote: Toby A Inkster wrote: Els wrote: Which special chars are between Z and a then? Noob here - I just thought it would either go AaBbCc.. or ABC...XYZabc...xyz ? There are six characters between 'Z' and 'a': [\]^_` Thanks - I had no idea.. :-) http://www.asciitable.com/ |
#24
| |||
| |||
|
|
Toby A Inkster wrote: Els wrote: Which special chars are between Z and a then? Noob here - I just thought it would either go AaBbCc.. or ABC...XYZabc...xyz ? There are six characters between 'Z' and 'a': [\]^_` Thanks - I had no idea.. :-) |
#25
| |||
| |||
|
|
Els wrote: Shows I'm not a real geek snip You can be. Just stick with us. ![]() |
#26
| |||
| |||
|
|
Okay, I've scoured the php manual and apparently the following insert if designated as caseless: [A-Z] will indeed include a-z. In some foreign languages that have umlauts and other gazinckisses, such letters may be also included. |
|
And thanks for uploading the nice pics. Only one! the rest is NOT mine - not taking responsibility for those Really? I wonder who uploaded the foggy sun and vale one? Anyway, there was quite a rush last night, and it was interesting. |
|
(PS: Did you see Blinky's behemoth killer shark?) |
#27
| |||
| |||
|
|
Blinky the Shark wrote: Els wrote: Toby A Inkster wrote: Els wrote: Which special chars are between Z and a then? Noob here - I just thought it would either go AaBbCc.. or ABC...XYZabc...xyz ? There are six characters between 'Z' and 'a': [\]^_` Thanks - I had no idea.. :-) http://www.asciitable.com/ Shows I'm not a real geek |

#28
| |||
| |||
|
|
I'm no PHP wizard, nor do I know much about regexp, but for those who are, this is the part in the script that seems to check the email address: // Check the email address enmtered matches the standard email address format if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email)) { echo "<p>It appears you entered an invalid email address</p><p><a href='javascript: history.go(-1)'>Click here to go back</a>.</p>"; } |
#29
| |||
| |||
|
|
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email)) { Just two notes: 1) Using such checks should be done carefully. A proper RFC-compliant address check _cannot_ be done with such a simple regex. Almost every regex I saw will still allow many invalid addresses and reject valid ones. The RFC 822 is a quite complex beast. Mail::RFC822::Address: regexp-based address validation http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html PHP : Parsing Email Adresses in PHP http://www.iamcal.com/publish/articl...parsing_email/ |
|
The second one seems to work quite well, but still is not fully RFC- compliant (but should be enough in most cases, though). 2) The ereg_* functions are dead and will be removed in PHP6. The preg_* (PCRE) functions are the way to go and much more powerful and efficient. |
#30
| |||
| |||
|
|
Ben C wrote: On 2008-03-27, Els <els.aNOSPAM (AT) tiscali (DOT) nl> wrote: Sounds like the safest bet would be to use A-z ? That's a good idea, although I don't have total confidence that it's either AaBbCc... or ABC...abc... and not some other other strange order in some locales. Locale is irrelvant. It's just ASCII. You can find the order in any ASCII chart. There are many around the web. |
![]() |
| Thread Tools | |
| Display Modes | |
| |