Extending BBCode…

Shabby man exits shack

This week I have been mostly rewriting bulletin board software.

Man enters shack

And earlier today it occured to me that in addition to the usual gamut of BBCode tags ([b], [u], [i], [strike], [url] etc) there were actually quite a few other things I could do with adding to my list of BBCode tags.

For instance, one of the things I do regularly on this very blog is refer to Wikipedia article, so a quick way to accomplish that might be good.

So, how about [w]Peaceville[/w] which would give you Peaceville, or [w=Cleckheaton]the Luddite area[/w] which would give you the Luddite area.

But that’s not all. There are lots of other website it may be useful to provide easy links to:

Dictionary.com: [d]code[/d] = code

Thesaurus.com: [d]cheesy[/d] = cheesy

Google: [g=pies]find tasty pies[/g] = find tasty pies

I’ll leave the development of the regular expressions to make this codes work as an excercise for the reader :0)