On Wed, 24 Nov 2004 13:17:48 -0500, Ankur Os wrote:

> Hi,
> 
> This is quite simpal problem that i want to made regular expression which
> can read this kind of structure...
> 
> a,b,c
> 
> not like this
> 
> 1.  ,a,a,a
> 2.  a,,,aa,,
> 3.  a,a,a,,,
> 
> means simpal structure with comma (a,b,c...)
Hi,

Try this (untested) :

preg_match('/^([a-c],)*[a-c]$/', $input);

this will match characters a-c separated by commas. Replace 'a-c' by any
range of characters you like.

HTH,

Ivo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to