$re = '/>[\w\s]+</m';
$str = '<p><span style="color: rgb(166, 25, 133);"> tE</span>XT HJKHK jhjklj<span style="color: rgb(58, 181, 195);">n bсbrjmhnjmhnj</span></p><p><br></p><p><span style="color: rgb(58, 181, 195);">bnjksahdjsa </span><b style="color: rgb(58, 181, 195);">sdasadsa</b><b style="color: rgb(95, 17, 77);"> sddsdwsd </b></p>';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php