use preg_match instead of ereg
made method abstract
fixed typo
fixed phpdocs