in reply to to be or not to be...

Wouldn't /^(?:bb)|(?!bb)$/ work better?

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: to be or not to be...
by Jenda (Abbot) on Apr 08, 2003 at 15:56 UTC

    Well, not. That would mean "to be at the beginning or not to be at the end". And the /(?!bb)$ would match anything. If you are at the very end of the string you may be sure there are not two more "b"s left. :-)

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature