in reply to Re^2: IT's not counting...
in thread IT's not counting...

What kind of changes do you mean?

By "many changes" I mean that my approach is simply to match number of right brackets against number of left brackets which would return true even in following cases

etc.

For additional constraints, you'll have to think about combination of possible correct/incorrect cases before you could claim that your script is working as expected.

Replies are listed 'Best First'.
Re^4: IT's not counting...
by Dwood (Acolyte) on Nov 16, 2010 at 09:47 UTC
    Oh Jeeze I didn't even think about those kinds of cases...

    For what I need I believe that as it checks each expression for validity (i'm interpreting lisp-like expressions) before it runs should rule that out. E.G. )+ <item1> <item2>)(( won't work because (in theory) )+ doesn't match up.

    Because you posted that, however I'm definitely posting up links to a repo/cpan module I make of this so those interested can stress-test what I make.