Well, if it says it is deprecated it does not work that it does not work anymore. Just that PHP advises developers to steer away from deprecated code and/or functions and use the new ones.
However, if you are still motivated to use the eregi_replace() function even though it is deprectead, just add @ to it so that the warning message for this will not appear.
Remember, just add @. So it will be @eregi_replace().