BBCode


BBCode or Bulletin Board Code is a lightweight markup language used to format posts in many message boards. The available tags are usually indicated by square brackets surrounding a keyword, and they are parsed by the message board system before being translated into a markup language that web browsers understand—usually HTML or XHTML.
BBCode was introduced in 1998 by the messageboard software Ultimate Bulletin Board implemented in Perl, which has evolved into the PHP package UBB.threads. In 2000 BBCode was used in phpBB—an internet forum system written in PHP and also XMB forum. vBulletin also uses BBCode, as does XMB Forum 2.

Tags

Implementation

BBCode is typically implemented by applying a series of regular expression string-replace operations upon the input. Because regular expressions are limited in analyzing the structure of text input, this has the artifact that any non-hierarchical BBCode input will be transformed into invalid non-hierarchical HTML without error.
Applying traditional parsing techniques is made difficult by ambiguities in the markup, such as in, where the input can either be interpreted as "text" quoted from someone called, or the bolded text "text" surrounded by and, i.e. .