<?php
$str = '
<font color="maroon">[como]</font> <rel> <ks> <font color="blue"><b>ADV</b> </font> <font color="darkgreen">@ADVL></font> <font color="darkgreen"><b>@#FS-ADVL</font></b> <font color="darkgreen"><b>@#FS-N<</font></b>
<dt><b><font color="maroon">não</font></b>
<font color="maroon">[não]</font> <font color="blue"><b>ADV</b> </font> <font color="darkgreen">@ADVL></font>
<dt><b><font color="maroon">amar</font></b>
<font color="maroon">[amar]</font> <vt> <font color="blue"><b>V</b> FUT 1/3S SUBJ VFIN </font> <font color="darkgreen">@FMV</font>
<dt><b><font color="maroon">uma</font></b>
<font color="maroon">[um]</font> <arti> <font color="blue"><b>DET</b> F S </font> <font color="darkgreen">@>N</font>
<dt><b><font color="maroon">pessoa</font></b>
<font color="maroon">[pessoa]</font> <H> <font color="blue"><b>N</b> F S </font> <font color="darkgreen">@<ACC</font>
<dt><b><font color="maroon">tão</font></b>
<font color="maroon">[tão]</font> <dem> <quant> <font color="blue"><b>ADV</b> </font> <font color="darkgreen">@>A</font>
<dt><b><font color="maroon">linda</font></b>
<font color="maroon">[lindo]</font> <font color="blue"><b>ADJ</b> F S </font> <font color="darkgreen">@N<</font>
<dt><b><font color="maroon">.</font></b>';
$regex ='/\[.*\]/';
echo '<pre>';
PD9waHAKCiRzdHIgPSAnCjxmb250IGNvbG9yPSJtYXJvb24iPltjb21vXTwvZm9udD4gICZsdDtyZWwmZ3Q7ICZsdDtrcyZndDsgPGZvbnQgY29sb3I9ImJsdWUiPjxiPkFEVjwvYj4gPC9mb250PiA8Zm9udCBjb2xvcj0iZGFya2dyZWVuIj5AQURWTCZndDs8L2ZvbnQ+IDxmb250IGNvbG9yPSJkYXJrZ3JlZW4iPjxiPkAjRlMtQURWTDwvZm9udD48L2I+IDxmb250IGNvbG9yPSJkYXJrZ3JlZW4iPjxiPkAjRlMtTiZsdDs8L2ZvbnQ+PC9iPgogICAgPGR0PjxiPjxmb250IGNvbG9yPSJtYXJvb24iPm7Do288L2ZvbnQ+PC9iPiAK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