title: Javascript extract numbers from a string
body: <p>I want to <strong>extract numbers from a string</strong> in javascript like following :</p>
  
  <p><strong>if  the string = 'make1to6' i would like to extract the numeric character before and after the 'to' substring in the entire string. i.e. 1 and 6 are to be extracted</strong></p>
  
  <p>The length of the string is not fixed and can be a max of 10 characters in length.The number can be of max two digits on either side of 'to' in the string.</p>
  
  <p><strong>Possible string values :</strong></p>
  
  <ul>
  <li>sure1to3</li>
  <li>ic3to9ltd</li>
  <li>anna1to6</li>
  <li>joy1to4val</li>
  <li>make6to12</li>
  <li>ext12to36</li>
  </ul>
  
  <p>thinking of something like :</p>
  
  <pre><code>function beforeTo(string) {
      return numeric_value_before_'to'_in_the_string;
  }
  
  function afterTo(string) {
      eturn numeric_value_after_'to'_in_the_string;
  }
  </code></pre>
  
  <p>i will be using these returned values for some calculations.</p>