title: How to combine this regex into one
body: <p>I am trying to extract the last word of a string but ignoring any extension it may have 
  e.g. <code>amazon_uk</code> instead of <code>amazon_uk.gif</code></p>
  
  <p>The following code extracts the word from the string using 2 preg_match functions, I want to be able to do the same thing in 1 preg_match, how can I do this?</p>
  
  <p><strong>php code</strong></p>
  
  <pre><code>$str = 'http://i.example.com/about/bs/logo_borderless/amazon_uk.gif';
  
  preg_match('/[^\.\/]+\.[^\.\/]+$/', $str, $matches);
  preg_match('/^[^.]+(?=.)/', $matches[0], $matches2);
  $website = $matches2[0];
  </code></pre>
  
  <p><strong>output</strong></p>
  
  <pre><code>amazon_uk
  </code></pre>