title: Use regular expression to extract attribute value for custom tag
body: <p>Thanks for taking a look at this. I'm using PHP. I have a string like so:</p>
  
  <pre><code>[QUOTE="name: Max-Fischer, post: 486662533, member: 123"]I don't so much dance as rhythmically convulse.[/QUOTE]
  </code></pre>
  
  <p>And I want to pull out the values in the quotes and create an associative array like so:</p>
  
  <pre><code>["name" =&gt; "Max-Fischer", "post" =&gt; "486662533", "member" =&gt; "123"]
  </code></pre>
  
  <p>Then, I would like to remove the opening and closing [QUOTE] tags and replace them with custom HTML like so:</p>
  
  <pre><code>&lt;blockquote&gt;&lt;a href="URL_I_WILL_GENERATE_FROM_THE_ARRAY_VALUES"&gt;Max-Fischer&lt;/a&gt; wrote: I don't so much dance as rhythmically convulse.&lt;/blockquote&gt;
  </code></pre>
  
  <p>So the main problem is creating the preg_match() or preg_replace() to handle first: grabbing the values out in an array, and second: removing the tags and replacing them with my custom content. I can figure out how to use the array to create the custom HTML, I just can't figure how to use regular expressions well enough to achieve it.</p>
  
  <p>I tried a match like this to get the attribute values:</p>
  
  <pre><code>/(\S+)=[\"\']?((?:.(?![\"\']?\s+(?:\S+)=|[&gt;\"\']))+.)[\"\']?/
  </code></pre>
  
  <p>But this only returns:</p>
  
  <pre><code>[QUOTE
  </code></pre>
  
  <p>And that's not even addressing how to put the values (if I can get them) into an array.</p>
  
  <p>Thanks in advance for your time.</p>
  
  <p>Cheers.</p>