PDA

View Full Version : regex and bbcode


merk
11-01-2005, 12:22 AM
I have a piece of text that has been retrieved from a vBulletin database. It may or may not contain bbcodes of any kind (img, html, code, php, b, i, so on).

I wish to remove all bbcode tags, but I also want to remove links that appear inside img tags.

Is it possible to do it with regex? At the moment im using a modified strip_bbcode() function to look for each tag, but its slow, and id like to use a single preg function if i could. (if they need to be different for img, thats fine too)

can anyone point me in the direction? :\