fork(1) download
  1. <?php
  2.  
  3. $str = '
  4. <font color="maroon">[como]</font> &lt;rel&gt; &lt;ks&gt; <font color="blue"><b>ADV</b> </font> <font color="darkgreen">@ADVL&gt;</font> <font color="darkgreen"><b>@#FS-ADVL</font></b> <font color="darkgreen"><b>@#FS-N&lt;</font></b>
  5. <dt><b><font color="maroon">não</font></b>
  6.  
  7. <font color="maroon">[não]</font> <font color="blue"><b>ADV</b> </font> <font color="darkgreen">@ADVL&gt;</font>
  8. <dt><b><font color="maroon">amar</font></b>
  9.  
  10. <font color="maroon">[amar]</font> &lt;vt&gt; <font color="blue"><b>V</b> FUT 1/3S SUBJ VFIN </font> <font color="darkgreen">@FMV</font>
  11. <dt><b><font color="maroon">uma</font></b>
  12.  
  13. <font color="maroon">[um]</font> &lt;arti&gt; <font color="blue"><b>DET</b> F S </font> <font color="darkgreen">@&gt;N</font>
  14. <dt><b><font color="maroon">pessoa</font></b>
  15.  
  16. <font color="maroon">[pessoa]</font> &lt;H&gt; <font color="blue"><b>N</b> F S </font> <font color="darkgreen">@&lt;ACC</font>
  17. <dt><b><font color="maroon">tão</font></b>
  18.  
  19. <font color="maroon">[tão]</font> &lt;dem&gt; &lt;quant&gt; <font color="blue"><b>ADV</b> </font> <font color="darkgreen">@&gt;A</font>
  20. <dt><b><font color="maroon">linda</font></b>
  21.  
  22. <font color="maroon">[lindo]</font> <font color="blue"><b>ADJ</b> F S </font> <font color="darkgreen">@N&lt;</font>
  23. <dt><b><font color="maroon">.</font></b>';
  24.  
  25. $regex ='/\[.*\]/';
  26. preg_match_all($regex, $str, $matches);
  27.  
  28. echo '<pre>';
  29. print_r($matches);
  30.  
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
<pre>Array
(
    [0] => Array
        (
            [0] => [como]
            [1] => [não]
            [2] => [amar]
            [3] => [um]
            [4] => [pessoa]
            [5] => [tão]
            [6] => [lindo]
        )

)