Remove use of ereg()

Closes gh-96.