I would like to insert a class with regex and preg_replace
echo preg_replace("/<li\>\s*<p\>[a-z]\)\s/", "/<li class=\"inciso\"\>\s*<p\>[a-z]\)\s/", $documento);
This is the model of text that I haveEste é o modelo das linhas do meu documento:
<li>
<p>a) long text</p>
</li>
<li>
<p>b) long text</p>
</li>
<li>
<p>c) long text</p>
</li>
New example, let´s say that is not a HTML, is just a simple list, and you wanna a change from this:
a) long text
b) long text
c) long text
To this:
a) new text long text
b) new text long text
c) new text long text
echo preg_replace("/[a-z]\)\s/", "/[a-z]\)\snew\stext/", $documento);
Is this correct?