Skip to main content

Posts

Showing posts from October, 2008

Basic "Custom Tags" Parsing Script

Today we are going to create a basic Custom Tags parsing script that will parse special symbols (tags) in text for formatting purpose. Just like writing <b>BOLD</b> , a web browser parses it as “BOLD” in bold letters, same way our script will parse tags created by us. One very popular example of custom tag parsing for formatting purpose is, BBCode which most of the bulletin boards use to let users format their posts. This will be a basic example of parsing custom tags so we will only be parsing two tags. One will convert the enclosing text into bold and other will be used for italics. After understanding the basic idea, you can easily add more tags according to your needs and can also use it wherever necessary. One of its good use will be in Shout Boxes that we had designed a few months back. Though many would like the use of Regular Expressions for parsing, we will not be using them here. For the sake of simplicity, we will be using on