I need to do a simple regex find and replace with PHP for my syntax highlighting script in PHP.
I need to take a string of code which will actually be a whole php file that is read into a string like this.
$code_string = 'the whole source code of a php file will be held in this string';
And then find all occurences of these and do a replace...
Find: [php] and replace with <pre class="brush: php;">
Find: [/php] and replace with </pre>
Find [javascript] and replace with <pre class="brush: js;">
Find: [/javascript] and replace with </pre>
I really am not good with regex could someone please help me with this?