Use preg_match instead of eregi. Fixes #1