doddsey_65 Posted March 9, 2011 Share Posted March 9, 2011 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 More sharing options...
btherl Posted March 9, 2011 Share Posted March 9, 2011 Are you sure it's your regexp removing the html? Try printing your data out using htmlentities() immediately before and after the regexp is applied. Or copy the regexp into a seperate file and use that file for testing it. Link to comment https://forums.phpfreaks.com/topic/230108-regex/#findComment-1185165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.