title: regular expression php to parse a file
body: <p>I want to parse a file, and store it into an <code>Array</code> in <code>PHP</code>. However, there are some rules which should the observed:</p>
  
  <ul>
  <li>(p="value") should be ignored, but the <code>"value"</code> should be preserved.</li>
  <li><code>-</code> should be ignored.</li>
  <li>whitespaces should be ignored. </li>
  <li>split by <code>\t</code> and <code>\n</code>.</li>
  </ul>
  
  <p>A sample string is :</p>
  
  <pre><code>NPD4196-2a_5_0
  Geldanamycin - 0.166516 (p = 0.0068)    Alamethicin - 0.158302 (p = 0.0206)     4-Hydroxytamoxifen - 0.1429 (p = 0.0183)        Abietic acid - 0.133045 (p = 0.0203)    Caspofungin - 0.130885 (p = 0.0432)     Extract 00-303C - 0.12858 (p = 0.0356)  U73122 - 0.113274 (p = 0.0482)  Radicicol - 0.10213 (p = 0.0356)        Calcium ionophore - 0.096183 (p = 0.0262)
  </code></pre>
  
  <p>So, the goal is to produce a data structure like:</p>
  
  <pre><code>Array('NPD4196-2a_5_0' =&gt; Array(Array( 0 =&gt; 'Geldanamycin', 1 =&gt; '0.166516', 2 =&gt; '0.0068'), Array( ... ));
  </code></pre>
  
  <p>I have this written so far ... </p>
  
  <pre><code>while(($line = fgets($fp)) !== false){
          $args = preg_split( '/[\t\n (=) ]+/', $line, -1, PREG_SPLIT_NO_EMPTY );
          if(count($args)){
             print_r($args);
             print "\n";
          }
  }
  </code></pre>
  
  <p>What am I missing in other to accomplish my goal?
  Thanks</p>