title: PHP preg_replace regular expression
body: <p>How to remove anything before a given character and anything after a given character with preg_replace using a regular expression? Of course this could be done in many other ways like explode and striping the string. But I am curious about preg_replace and regex.</p>
  
  <p>So the only thing I need from the string below is <strong>03b</strong> and remove every thing before/and slash (/) and after/and dot (.) </p>
  
  <pre><code>$string = 'rmbefore/03b.rmafter'
  </code></pre>
  
  <p>Thanks in advance!</p>