You are here: Re: Need help with a regular expression please. « PHP Language « IT news, forums, messages
Re: Need help with a regular expression please.

Posted by William Park on 08/06/05 03:13

In <comp.unix.shell> marcy klein <no_email@noemail.com> wrote:
> Hi. I'm trying to create a regular expression for a form field validation
> that would permit input something like this:
>
> +1 (1-23) 321.1234 ext.12
>
> Any numbers 0-9, plus signs, parentheses (open and close), periods (dots),
> hyphens, alpha characters e, x, and t, and blank spaces.
>
> I have thus far been working with:
>
> ^[0-9ext\(\)\+\.\-]*$
>
> Hmm, I should make the alpha characters case insensitive as well. But the
> problem I'm having is including blank spaces.

^[ 0-9ext()+.-]*$

> As you can see from the
> example input string above, there are blank spaces in the string. Thus far,
> however, I've not been able to construct my regular expression to permit
> blank spaces. Any suggestions or help would be appreciated. TIA (Running
> Mandrake Linux, BASH, PHP.)
>
> Marcy

--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
http://freshmeat.net/projects/bashdiff/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация