It you're going to allow (a+b)' — the OP might be happy with only supporting /\w+'/ — you must allow (a*(b+c))' too.
Other than that, there are a few other problems. You don't handle xor, you assume the same precedence and associativity as Perl, and you don't generate a truth table. I presume that's intentional and that you're leaving those as an exercise to the reader, so I'm just documenting what's left to do.
In reply to Re^5: Generate a truth table from input string
by ikegami
in thread Generate a truth table from input string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |