title: preg_match in JavaScript?
body: <p>Is it possible in <code>JavaScript</code> to do something like <code>preg_match</code> does in <code>PHP</code> ?</p>
  
  <p>I would like to be able to get two numbers from string:</p>
  
  <pre><code>var text = 'price[5][68]';
  </code></pre>
  
  <p>into two separated variables:</p>
  
  <pre><code>var productId = 5;
  var shopId    = 68;
  </code></pre>
  
  <p>Edit:
  I also use <code>MooTools</code> if it would help.</p>