title: How are nested groups addressed in RegEx?
body: <p>Suppose I have a text like this:</p>
  
  <pre><code>/TT0 1 Tf
  0.002 Tc -0.002 Tw 11.04 0 0 11.04 221.16 707.04 Tm
  [(\()-2(Y)7(o)7(u )-3(g)7(o)-2(t)4(i)-3(t)(\))]TJ
  EMC 
  </code></pre>
  
  <p>It is part of a PDF file. The line</p>
  
  <pre><code>[(\()-2(Y)7(o)7(u've )-3(g)7(o)-2(t)4(i)-3(t)(\))]TJ
  </code></pre>
  
  <p>contains the text "(You've got it)". So I first need to match text lines</p>
  
  <pre><code>^[(.*)]TJ$
  </code></pre>
  
  <p>Having the capture group of that, I can apply <code>\(((.*?)\)[-0-9]*)</code> and replace all matches by <code>\2</code>.</p>
  
  <p>Is it possible to do this in one step?</p>