title: How to parse a sine function?
body: <p>I have String input with a sin (b(x-c)) + d as its format. What is the delimiter expression I should use to split it so that I can use Integer.parse to obtain the numerical values for a, b, c and d? </p>
  
  <p>So, if string input is </p>
  
  <pre><code>sin 5x                   a=1, b=5, c=d=0
  sin 5(x-4)               a=1, b=5, c=4, d=0
  2  sin 3(x-2)           a=2, b=3, c=2, d=0
  sin 5x + 3               a=1, b=5, c=0, d=3
  4  sin 7(x+6) + 2       a=4, b=7, c=-6, d=2
  11  sin 2x              a=11, b=2, c=d=0
  </code></pre>