Fixed a bug in MatchBBCode function