Thanks Garrett - I'll play with that his evening !

Paul Newton

Garrett Fitzgerald wrote:
> On 11/1/07, Paul Newton <[EMAIL PROTECTED]> wrote:
>   
>> Hi all
>>
>> I need to check an input value against the following criteria
>>
>> 1. Length 1 - 10 characters
>> 2. Each character may be either "C" or "N"
>> 3. All C's must be in a group, so CCNNC would be invalid
>> 4. All N's must be in a single group (as above)
>> 5. Can be all C's
>> 6. Can be all N's
>> 7. Can be x C's followed by y N's
>> 8. Can be x N's followed by y C's
>> 9. 1 <= x+y <= 10 (same as 1 above, really)
>>     
>
> I think this regexp meets all your criteria except the total length.
>
> (C+N{0,9}(?!C)|N+C{0,9}(?!N))
>
> You can do that with a LEN, I suppose.... Be nice if someone else can
> chime in with a way to do it all in the RegExp, without having to
> specify all the matches. :-)
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to