Yeah I agree with John, ereg & eregi have been deprecated since PHP 5.0.3
so you should use preg_match instead for compatability sake.

Something like below(password must be min 4 to max 9...