RE: [PHP] ereg problem
| From: | Janet Valade | Date: | Wed, 14 Feb 2001 19:37:46 +0000 |
| Subject: | RE: [PHP] ereg problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-39728@lists.php.net to get a copy of this message | ||
Thank you. That was exactly the problem.
Janet
> -----Original Message-----
> From: Charlie Llewellin [SMTP:sallyevans@eden.infohwy.com]
> Sent: Wednesday, February 14, 2001 11:00 AM
> To: cczona@nospam.invalid; php-general@lists.php.net
> Subject: Re: [PHP] ereg problem
>
> the - needs to be immediately after the [ to include that character.
> Otherwise it is a range indicator.
>
> Charlie
> ----- Original Message -----
> From: "CC Zona" <cczona@nospam.invalid>
> To: <php-general@lists.php.net>
> Sent: Wednesday, February 14, 2001 12:56 PM
> Subject: Re: [PHP] ereg problem
>
>
> > In article <80B97DE95AEED311BA580050047FE98430D63F@mail.systech.com>,
> > janetv@systech.com (Janet Valade) wrote:
> >
> > > if (!ereg("^[0-9\-\+\.\ \)\(]{10,}$",$value)) {
> > >
> > > Can anyone tell me why this works for every character except the -. It
> > > doesn't see the hyphen as a valid part of the phone number, even
> though
> it
> > > recognizes the other characters, e.g. + or .
> >
> > Try:
> > if (!ereg("^[0-9+. )(-]{10,}$",$value))
> >
> > --
> > CC
> >
> > --
> > 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
> >
>
>
> --
> 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