Jump to content

Regex


doddsey_65

Recommended Posts

im trying to convert bbcodes into html for a preview but came across a problem.

The bbcode is .

 

But within those tags are some <span>s that are used for syntax highlighting. So when i use my current regex it removes those spans:

 

/\[code\](.*?)\[\/code\]/gi

<pre><code class="php">$1</code></pre>

 

is there anyway to keep everything between the tags? even the html code?

Link to comment
https://forums.phpfreaks.com/topic/230108-regex/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.