title: PHP Regex - match attribute and value in string
body: <p>I have an array of possible attributes:</p>
  
  <pre><code>$attributes = ['color','size'];
  </code></pre>
  
  <p>Part of my URL looks like this:</p>
  
  <pre><code>color-light-grey-size-xs
  </code></pre>
  
  <p>I would need to get an array of attributes and their values, ie:</p>
  
  <pre><code>$values = [
      'color' =&gt; 'light-grey',
      'size' =&gt; 'xs'
  ]
  </code></pre>
  
  <p>Is that doable with regex?</p>