Excuse the html email.&nbsp; It means I can highlight things and hence communicate more clearly.<br><br>First, I think you have an extra &#39;+&#39; character, which results in a double plus &#39;++&#39; being passed into preg_match()
<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><span style="font-family: courier new,monospace;">$regex = &quot;(\s*([a-z][a-z0-9\-]*)\s*:\s*([a-z][a-z0-9\-]*)\s*;)
<span style="background-color: rgb(255, 255, 51);">+</span>&quot;;</span><br style="font-family: courier new,monospace;"><div style="direction: ltr; font-family: courier new,monospace;">if (preg_match(&#39;/&#39;. $regex .&#39;
<span style="background-color: rgb(255, 255, 51);">+</span>/i&#39;, $text, $matches)) {...</div></blockquote><br>which calls <span style="font-family: courier new,monospace;">preg_match(&#39;/(\s*([a-z][a-z0-9\-]*)\s*:\s*([a-z][a-z0-9\-]*)\s*;)
<span style="background-color: rgb(255, 255, 51);">++<span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">/i&#39;, &#39;style=&quot;font-style: italic; font-weight: bold;&quot;&#39;, $matches))</span></span>
</span><br><br>Nevertheless, that&#39;s not the cause, because removing one or both plusses doesn&#39;t solve the problem.<br><br>The thing that strikes me as odd with this regex is the wrapping of the outer parenthesis, in a multiplier.&nbsp; I would instead look for a way of repeating the smaller regex on the string until the string is finished.&nbsp; This code;
<br><blockquote><span style="font-family: courier new,monospace;">$text = &#39;style=&quot;font-style: italic; font-weight: bold;&quot;&#39;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
$regex = &quot;\s*([a-z][a-z0-9\-]*)\s*:\s*([a-z][a-z0-9\-]*)\s*;&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">if (preg_match_all(&#39;/&#39;. $regex .&#39;/i&#39;, $text, $matches, PREG_SET_ORDER)) {
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; print_r($matches);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
}</span><br style="font-family: courier new,monospace;"></blockquote>returns this;<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><pre id="line1">
Array<br>(<br>    [0] =&gt; Array<br>        (<br>            [0] =&gt; font-style: italic;<br>            [1] =&gt; font-style<br>            [2] =&gt; italic<br>        )<br><br>    [1] =&gt; Array<br>        (<br>            [0] =&gt;  font-weight: bold;
<br>            [1] =&gt; font-weight<br>            [2] =&gt; bold<br>        )<br><br><span id="__firefox-tidy-id" style="background-color: rgb(221, 221, 255);">)</span>
  </pre></blockquote>Which I think is more similar to what you are seeking?<br><br>Also, I expect there is probably a php library that does this with simpler function calls than writing you&#39;re own ajax.&nbsp; Possibly as part of or related to the DOM class and related classes 
<a href="http://nz.php.net/manual/en/ref.dom.php">http://nz.php.net/manual/en/ref.dom.php</a><br><br>Cheers,<br>Bevan/<br><br>-- <br><a href="http://Drupal.geek.nz">Drupal.geek.nz</a> | Gtalk <a href="mailto:bevan@lucion.co.nz">
bevan@lucion.co.nz</a> | YIM rudgy_m_nz | .Mac/AOL b.rudge | skype b.rudge | <a href="http://Twitter.com/BevanR">Twitter.com/BevanR</a>