don't use ereg and ereg_replace (fix #51)