preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg().