title: regex in php to get two strings between slashes
body: <p>I have string, which have following syntax:</p>
  
  <pre><code>$string="/foo/XXX/bar/YYY"
  </code></pre>
  
  <p>and I need to get XXX and YYY. It is quite simple regex, but I'm a bit struggling with syntax in php, so could you help me out? :) </p>