Implementing phalcon_preg_match