as i say in title i'm learning how to make syntax highlighter to mysql code using regex in php
here is my code i just tried to do
$css = '<style> body{font-family:tahoma;font-size:12px;}</style>';
$lista = 'select|insert|update|delete|drop|truncate|alter' ;
$lista2 = 'into|from|values|desc|asc|on' ;
$lista3 = 'where|order by|limit|having|group by|union|left join|right join|full join|outer join|inner join' ;
$code = preg_replace('/('.$lista.')/i','<br /><span style="color:#f00;">$1</span>',$this->query);
$code = preg_replace('/('.$lista3.')/i','<br /> <span style="color:#0f0">$1</span>',$code);
$code = preg_replace('/('.$lista2.')/i','<span style="color:#00f">$1</span>',$code).$css;
my result was like this img
i want to use simple way to do this
but i shouldn't use any plugin just regex to understand it too