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

--
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