title: Is there possible to check mathematical expression string?
body: <p>I want to check all brackets start and close properly and also check it is mathematical expression or not in given string. </p>
  
  <p>ex : </p>
  
  <p><code>$str1 = "(A1+A2*A3)+A5+(B3^B5)*(C1*((A3/C2)+(B2+C1)))"</code></p>
  
  <p><code>$str2 = "(A1+A2*A3)+A5)*C1+(B3^B5*(C1*((A3/C2)+(B2+C1)))"</code></p>
  
  <p><code>$str3 = "(A1+A2*A3)+A5++(B2+C1)))"</code></p>
  
  <p><code>$str4 = "(A1+A2*A3)+A5+(B3^B5)*(C1*(A3/C2)+(B2+C1))"</code></p>
  
  <p>In above Example <code>$str1</code> and <code>$str4</code> are valid string....</p>
  
  <p>Please Help....</p>