There is a little bug in there, which would made it work incorrectly if only negative numbers were given. To fix it, change this:
/(.+?)
to this:
/(.*?)