Re: Regular Expression Help
| From: | Christian Reiniger | Date: | Tue, 22 May 2001 20:13:44 +0000 |
| Subject: | Re: Regular Expression Help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53913@lists.php.net to get a copy of this message | ||
On Tuesday 22 May 2001 19:44, Jason Caldwell wrote:
> I'm trying to figure out how to "say" with a Regular Expression how to
> check for the following characters in a phone number:
>
> ( ) -
>
> with a length between 1 and 20 --
preg_match ('/^[\d()-]{1,20}$/', $Subject)
should do the trick.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
Nothing is more dangerous than an idea if it's the only one you have.
- Emil-Auguste Chartier, "Propos sur la religion", 1938