now my problem is replace all line from # and from /* to */(for comments).
I have code:
<span>#include <a_samp><br />#define NUMBER 5<br />/* Long Comment */ new var[128]; format(var, sizeof(var), "kažkas %s %f", "Stuneris", 1589.0587); SendClientMessage(playerid, 0xFFFFFFFF, var);</span>
and I want to replace from # all line to <h1>#...(line)</h1> and from /* to */ to <h3>/* Long Comment */</h3>
I tired preg_replace('/(/*(?!,)[^"]+*/)/i', '<h3>$1</h3>', $text);, but it show warning Warning: preg_replace(): Unknown modifier '*' in C:\xampp\htdocs\pawn.php on line 18
I know, I need preg_replace, but how combination of search?
You’ll need to escape the special characters in you regexp
DEMO