in reply to Re: Determining if you have balanced delimiters
in thread Determining if you have balanced delimiters

No, it works. It was supposed to do that. :-)

The idea is that it repeatedly matches a pair and removes it while it can. When it is done, it then checks if any were left over.

  • Comment on Re (tilly) 2: Determining if you have balanced delimiters

Replies are listed 'Best First'.
Re: Re (tilly) 2: Determining if you have balanced delimiters
by merlyn (Sage) on Nov 21, 2000 at 18:01 UTC
    Well, in that case, it's another problem, since the dot can match the escape character, so it'll incorrectly blast "(\)".

    I knew it was something. {grin}

    -- Randal L. Schwartz, Perl hacker

      Did you test it?

      It recognizes "(\)" as unbalanced. OTOH he *didn't* bother to have an escape escape an escape. So "(\\)" is still unbalanced.

      But that could be a question of definition, not a bug.