Replacing deprecated ereg calls