title: Alternative to deprecated RegExp.$n object properties
body: <p>I like using the <code>$n</code> properties of <code>RegExp</code> (<code>RegExp.$1</code>, <code>RegExp.$2</code> etc) to create regular expression one-liners.
  Something like this: </p>
  
  <pre><code>var inputString = '[this is text that we must get]';
  var resultText = /\[([^\]]+)\]/.test(inputString) ? RegExp.$1 : '';
  console.log(resultText); 
  </code></pre>
  
  <p>The MDN docs say that these properties are now deprecated. What is a better non-deprecated equivalent? </p>