Re: Re: Validate Value
| From: | Rinku | Date: | Sun, 11 Jul 2004 10:28:45 +0000 |
| Subject: | Re: Re: Validate Value | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35193@lists.php.net to get a copy of this message | ||
Can you pls tell me how to add space in name ?
Regards,
Rinku
Tim Van Wassenhove <euki@pi.be> wrote:
In article <20040711064659.27961.qmail@web54107.mail.yahoo.com>, Rinku wrote:
> --0-775821546-1089528419=:27331
> Content-Type: text/plain; charset=us-ascii
>
> Pls guide on following.
> 1) I want to validate name for a alphabetic value, But if I give space between 2 words then its
> not supporting..
That's correct behaviour. The alphabet doesn't know what a space is ;)
Thus append the other allowed characters to your a-zA-Z interval.
> 2)I want to validate a phone no for 10 digits. But in this value if I enter "+" or
> "-" in begining then even
> the system will accept it. So can you pls suggest me what to do to solve the problem ?
In this case you only want to allow characters in the interval 0-9. I
think \d is a shortcut for that. And to limit it to only 10 occurences,
i believe you can use {0,10} so you end up with \d{0,10} if i'm not
mistaken (consult a regular expressions manual to be sure)
--
Tim Van Wassenhove
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!