Replace deprecated function ereg by preg_match