Then in reg. expression, you have to check for this:
'(\[b\])?(\[\/b\])'
or something like that.
So, you're looking for regular expression that in one line has both opening and closing tag, and use replace function to fix it.
I'm not sure if ? will work for all characters between, data might be able to tell you that. (or just check reference on the page you posted above)
When you are done, check for tags that have no matching opening/closing tag.
|