Re-designed TextFormatter to use regEx