Ricardo and Garrett
Thank you both so much - I am quite sure that I would not have come up
with anything as good (at least not for a long time).
Paul Newton
Ricardo Aráoz wrote:
> Garrett Fitzgerald wrote:
>
>> On 11/3/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote:
>>
>>> Garrett Fitzgerald wrote:
>>>
>>>> On 11/3/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote:
>>>>
>>>>> ^(?!.{11,})(?:(?:C{0,10}N{0,10})|(?:N{0,10}C{0,10}))$
>>>>>
>>>>> Explanation : matches a beginning of string not followed by 11 or more
>>>>> characters (that would be up to 10 characters total string length) and
>>>>> then either none to 10 C's followed by none to 10 N's or none to 10 N's
>>>>> followed by none to 10 C's.
>>>>>
>>>> That's almost exactly it. Nice job. You just need to change it so the
>>>> first range in each is {1,10} so that it doesn't match the empty
>>>> string.
>>>>
>>> But isn't a string of all C's (or N's) a valid one? Then you must have
>>> {0,10}.
>>>
>> You do: it's just the second range on each side of the or.
>>
>> ^(?!.{11,})(?:(?:C{1,10}N{0,10})|(?:N{1,10}C{0,10}))$
>>
>>
>>
>
> Smart!
>
>
_______________________________________________
Post Messages to: [email protected]
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.