in reply to Regular Expression Question
This expression should do it:
/(\w+(?:\,\w+)*)/
Update: the OP adds above "if I wanted to check for more than 2 consecutive commas", which requires a minor change:
/(\w+(?:\,{1,2}\w+)*)/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regular Expression Question
by nevyn (Monk) on Dec 04, 2003 at 20:48 UTC | |
by simonm (Vicar) on Dec 04, 2003 at 20:59 UTC | |
by nevyn (Monk) on Dec 04, 2003 at 21:45 UTC | |
by Abigail-II (Bishop) on Dec 05, 2003 at 15:09 UTC | |
by simonm (Vicar) on Dec 05, 2003 at 21:56 UTC | |
|
Re: Re: Regular Expression Question
by hardburn (Abbot) on Dec 04, 2003 at 21:40 UTC | |
|
Re: Re: Regular Expression Question
by TASdvlper (Monk) on Dec 05, 2003 at 14:56 UTC |