neviem ci sa to da cisto s regularnymi, ja sam ich nejako neovladam...
mozno troska krkolomne riesenie, ale budis, aspon sa mas coho chytit
Kód:
$str = '<a href="color:red;" style="color:red;border:1px solid gray;line-height:18px;background:yellow;">asd</a> color:red; <b style="color:red;">asd</b>';
preg_match_all('#<a (.*?) style="(.*?)"#', $str, $styles);
foreach($styles[2] as $style){
$style = 'style="'.$style.'"';
$rep = preg_replace('#(font-size|font-family|color|line-height):(.*?);#', '', $style);
$str = str_replace($style, 'style="'.$rep.'"', $str);
}
echo $str;