title: Regular expression in PHP fgetcsv
body: <p>I have a cycle in my code where I want to extract only the first, fifth and sixth number from an array that looks like this:</p>
  
  <pre><code>Array ( [0] =&gt; 12403;644;20;46;5;285;;;; )
  </code></pre>
  
  <p>I am currently trying to use regular expressions to extract those numbers (in this case I need to get 12403, 5 and 285).</p>
  
  <pre><code>$contents = fgetcsv($handle);
  preg_match('/^(\d+);\d+;\d+;\d+;(\d+);(\d+);*.$/', $contents, $match);
  echo "first capture group: " . $match[0] . "\nsecond capture group: " . $match[1] . "\nthird capture group: " . $match[2];
  </code></pre>
  
  <p>This prints out empty variables. Why? Can you please help?</p>