This is a port of WordPress' brilliant shortcode feature for use outside of WordPress. The code has remained largely unchanged.