Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing BBCode

Status
Not open for further replies.

Geee

Programmer
Joined
Apr 23, 2001
Messages
253
Location
GB
Is there an easy way to remove BBCode entries from a text field before it is displayed? I guess I need to remove anything wrapped in square brackets from my text field but I have no idea how to start going about this.

G

-Geeeeeeeeeeeeeeeeeeeeeeee-
-=
 
use regular expressions replace. this should get you started:
Code:
replace(/\[([a-z]+.*)\](.*)\[\/\1\]/g, "$2")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top