How to validate a formula's parentheses are correct. Parentheses can be nested.
Sigiloso
In Perl: - Input the formula as a string variable. - Use pattern matching ( =~ m/(/ )to count number of open "(" and closed ")" parentheses. - If both counts equal, formula is valid.