title: Regex to find `$this->request->data['utility_location_id']`
body: <p>I want to match the following string:</p>
  
  <p><code>$this-&gt;request-&gt;data['utility_location_id']</code></p>
  
  <p>Tried:</p>
  
  <pre><code>[[$]this[-][&gt;]request[-][&gt;]data[\[\'](\w{0,22})[\'\]]
  </code></pre>
  
  <p>Replace with: <code>$this-&gt;request-&gt;getData\((\1)\)</code></p>
  
  <p>Returns: <code>$this-&gt;request-&gt;getData()utility_location_id']</code></p>
  
  <p>What I want: <code>$this-&gt;request-&gt;getData('utility_location_id')</code></p>
  
  <p>However : 
  The following one : </p>
  
  <p>FInd : 
  <code>[[$]this[-][&gt;]request[-][&gt;]data[\[\'](.*)[\'\]]</code></p>
  
  <p>Replace : <code>$this-&gt;request-&gt;getData\((\1)\)</code></p>
  
  <p>Output : <code>$this-&gt;request-&gt;getData('utility_location_id')</code></p>
  
  <p>But it also matches the following string : </p>
  
  <pre><code>$this-&gt;request-&gt;data['utility_location_id']adasdadasd-&gt;datas  sad  sada ['utility_location_id']
  </code></pre>
  
  <p>which is a problem . How to fix it ? 
  I know it is for (.*) .</p>