title: How to write a regex that removes everything after $_POST['some_string']
body: <p>I have the following string:</p>
  
  <pre><code>string = '$_POST["a_string_of_unspecified_length"][4]input&amp;set1';
  </code></pre>
  
  <p>How to write a regex that will return only  <code>$_POST["a_string_of_unspecified-length"]</code> and discard everything after the first set of brackets</p>
  
  <pre><code>$string_afer_regex = '$_POST["a_string_of_unspecified_length"]'
  </code></pre>