Rewrite preg_match, add abstract, clean