Re: form validation :ereg ()

From: Date: Tue, 30 Jan 2001 10:47:43 +0000
Subject: Re: form validation :ereg ()
Groups: php.general 
Request: Send a blank email to php-general+get-37281@lists.php.net to get a copy of this message
Hi! thanks for the answer ! but for eregi("[^a-zA-Z[:space:]ëàéêêàäïüöûâç-]",$name); it accespts also numbers hen i give kaab1 as input it accept it ? strange ?! by the way how can i add the fact that the name should not start with space ? thanks a lot !
From: "Jeff Warrington" <jaydub@bossanova.com> To: php-general@lists.php.net Subject: Re: [PHP] form validation :ereg () Date: Mon, 29 Jan 2001 17:55:22 -0800 In article <F62eq5Z3JjQWrBSXaD800004bee@hotmail.com>, "kaab kaoutar" <kaab_k@hotmail.com> wrote: If you wish to include a hyphen in the allowed character list of a pattern match, you must include it as the last character. So what you want should be more like: if (eregi("[^a-zA-Zëàéêêàäïüöûâç-]",$name)) {
    print("your name can't include non-letter, etc....");
} You can add space with: [:space:] within the charachter class ([^a-zA-Z[:space:]ëàéêêàäïüöûâç-]) Jeff Hi again! I still did not fix my prob : I want to check, in a form, that the name input may include an alphabetical letter a- z, A-Z, or a space, or -, or à, or ä or ü etc how can i do that ? i used ereg("([a-z,A-Z][ë,à]?)",$name) then (!ereg("([a-z,A-Z,é,ê,è,ë,-,\t,à,ä,ï,ü,ö,û,â,ç])", $name)) i get the following warnin :REG_ERANGE:,invalid character range by the way how to add space " " and "-" ? Please help! 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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

« previous php.general (#37281) next »