Replaced mb_strlen with preg_match_all

mb_strlen is an optional function in PHP. In some rare instances it can
be unavailable and cause a fatal error. This method actually seems to
be more accurate, although i’m not sure if it carries any performance
implications.