php - regexp match string and digit
<p>I want to match this </p>

<pre><code>{format i=34 ds=11 k=a /}

$patern = "/\{format[a-z0-9=\s]?\/\}/i";
</code></pre>

<p>but result is null</p>

<p>In additional question:</p>

<pre><code>string string {format mat=34/} string string string string string string string string 

string string {format mat=34/} string string string string string string string string 
</code></pre>

<ol>
<li><p>$pattern = "/{format[a-z0-9=\s]*\/}/i";</p>

<p>str_replace($pattern, 'test', $strings);</p>

<p>it will replace all formats in string, i want to replace only first "format", and remove all another "format". How ? </p></li>
<li><p>when get match result is "{format mat=34/}". i want to find string begin with "mat=".</p></li>
</ol>

<p>So i have this </p>

<pre><code>$string = "{format mat=34/}";
$pattern = "/^mat=[0-9]*/"; // result is null
$pattern = "/mat=[0-9]*/"; // ok, but also effect with "{format wrongformat=34/}"
</code></pre>

<p>How to match string that begin with "mat="</p>
