in reply to Re: Re: Regular Expression Question
in thread Regular Expression Question

Either would work-- !/,,/ exludes strings containing 2 consecutive commas, and !/,{2,}/ excludes strings containing 2-or-more consecutive commas, which amounts to pretty much the same thing for what you want, if I've understood you correctly.

Replies are listed 'Best First'.
Re: Re: Re: Re: Regular Expression Question
by kesterkester (Hermit) on Dec 04, 2003 at 21:41 UTC
    Oop, sorry-- misread your question. If you wanted to check for more than 2 commas, you'd want to use either:
    /(\w+[\w,]+\w+)/ && !/,,,/

    or this:

    if /^(\w+[\w,]+\w+)$/ && !/,{3,}/;