title: PHP : preg_match_all none xhtml attributes
body: <p>I want to improve my code but I do not know how to write the regexp.</p>
  
  <p>I want to get all none xhtml attributes in a tag.</p>
  
  <p></p>
  
  <p>So after the preg match I want to get :</p>
  
  <pre><code>array(
    0 =&gt; "required",
    1 =&gt; "autocomplete"
  );
  </code></pre>
  
  <p><code>$balise = &lt;input id="myId" class="myClassA myClassB myClassC" required autocomplete/&gt;;</code></p>
  
  <p>I actually use this <code>preg_match_all("/(?&lt;=\s)[\w]+(?=[\s\/&gt;])/i", $balise, $attributs);</code></p>
  
  <p>But with the regexp I get :</p>
  
  <pre><code>array(
    0 =&gt; "myClassB",
    1 =&gt; "required",
    3 =&gt; "autocomplete"
  );
  </code></pre>
  
  <p>I do not want to get <code>myClassB</code>...</p>
  
  <p>can anyone help me to write my regex ?</p>
  
  <p>Thx</p>