only letters and space ?

if (eregi("^[A-Z ]+$", $firstname))

this will return true only if a case-insensitive string will contain only
letters and spaces... (and the string must not be NULL)

if (eregi("^([A-Z]+( )*[A-Z]+)$", trim($firstname)))\

this will return "Maxim Maletsky", "   Maxim Maletsky " but not "Maxim
Maletsky, jr" or even "MaximMaletsky  "

Cheers,
Maxim Maletsky

-----Original Message-----
From: kaab kaoutar [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 7:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ereg()


Hi
is the following right?
ereg("[a-zA-Zéêèë\sbàäïüöûâç-]", $firstname)
cause even when i type a number it accepts it ! however i want only letters 
- and space !
thanks

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to